Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
Prev Previous Post   Next Post Next
  #1  
Old 12-31-2006, 05:13 PM
pete_k104 pete_k104 is offline
 
Join Date: Dec 2006
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to display proper date on external website

Hello!

I've been working on getting a simple news display script to properly display the time, but to not avail. I'm getting December 31, 1969 (UNIX epoch - 1).

I'm doing a simple script that's just pulling all the newest entries in the thread table. It's getting the userid from the post table, and is displaying a custom field I made (that is meant for full/real name) from the userfield table (field5).

The code worked perfectly fine with a vbb 3.5.4 installation, and I see no difference between the two, other than mysql table structure. Dateline is the same entity in both 3.5.x and 3.6.x

I was decoding it using

PHP Code:
$date date("m, d, Y"$date); 
in each array object using the posts -> dateline value to show the date of the post. Dateline is stored as unixtime, based on the original Unix Epoch.

$date would be called in my array as

PHP Code:
$date $line['dateline']; 
Now, I've tried just making a bare script to take a dateline i feed it from the url to even test the date, and still no go.

I'm 100% sure it's not the server time, as I can successfully use

PHP Code:
date("m d Y"); 
I can also successfully feed it a dateline from vbb 3.5.4 and have a successful date echo.

My best guess is that date() cannot do the math properly against the unix epoch, and it is returning as -1, hence December 31, 1969. The reason why? My best guess is that vbb 3.6 stores dateline in a new format that date() cannot properly read.

Is my guess correct in saying that I must add a mathematical formula to have date() properly do the math against the epoch?
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:31 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09886 seconds
  • Memory Usage 2,291KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (2)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete