vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Dateline says it's 1969.. (https://vborg.vbsupport.ru/showthread.php?t=168139)

r_sole 01-19-2008 01:55 AM

Dateline says it's 1969..
 
Okay, I want to get the date of when a certain thread was created.

I'm doing this:
PHP Code:

// Get latest thread details
require("../dbinfo.php");
$conn mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db("MYSITE_forum");
$result mysql_query("SELECT * FROM vbulletin_thread WHERE forumid=4 ORDER BY threadid DESC LIMIT 1");
$threadinfo mysql_fetch_assoc($result);

//Check date thread
$dateline $threadinfo['dateline'];
$threadinfo_date date('m-d-Y'$dateline); 

Well I did that and echo'd $threadinfo_date and I got:
Code:

12-31-1969
I really doubt the thread was made then.

So what the hell, how do I get the actual date? Thanks :up:

Opserty 01-19-2008 09:19 AM

Run this above "Check date thread":
PHP Code:

var_dump($threadinfo['dateline']);
//Check date thread 

Whats the output? Also check that the other data is being returned such as the title and posting user. Finally you should order by dateline if you want the most recent thread as opposed to threadid, it just makes more sense.

r_sole 01-19-2008 11:04 AM

Quote:

Originally Posted by Opserty (Post 1424302)
you should order by dateline if you want the most recent thread as opposed to threadid, it just makes more sense.

Good point.

By the way, I figured out what the problem was. The forum I was looking in had no threads in it, so since php found no timestamp it probably just reverted back to 1969 (for some reason...I think it could be the 'default' or something like that).

Opserty 01-19-2008 11:11 AM

Quote:

Unix time, or POSIX time, is a system for describing points in time: it is the number of seconds elapsed since midnight UTC of January 1, 1970, not counting leap seconds.
So if it was set to zero (as it had found no timestamp) it would be the second before taking 01/01/1970 as 1. But you don't really need to worry about all that ;)


All times are GMT. The time now is 10:24 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02631 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete