vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Convert Data Field to Real Date (https://vborg.vbsupport.ru/showthread.php?t=187590)

CypherSTL 08-08-2008 09:54 PM

Convert Data Field to Real Date
 
Currently I have date fields in my database that just read: 1216276261

I have an external script that pulls information form the vBulletin Databases so using the vB Datamangers is not an option.

Can anyone point me in the right direction on how to convert that into a real date?

Thanks.

Opserty 08-08-2008 10:31 PM

<a href="http://php.net/date" target="_blank">http://php.net/date</a>

CypherSTL 08-08-2008 10:44 PM

Quote:

Originally Posted by Opserty (Post 1594367)

Been reading that article for a while before I posted here. I'm kinda stuck atm.

Opserty 08-08-2008 11:30 PM

What is your current code?

PHP Code:

// $datedata holds the "dateline" e.g. the "1216276261"

// Prints something like: Monday 8th of August 2005 03:12:46 PM
echo date('l jS \of F Y h:i:s A'$datedata); 


CypherSTL 08-08-2008 11:48 PM

Quote:

Originally Posted by Opserty (Post 1594391)
What is your current code?

PHP Code:

// $datedata holds the "dateline" e.g. the "1216276261"

// Prints something like: Monday 8th of August 2005 03:12:46 PM
echo date('l jS \of F Y h:i:s A'$datedata); 


Thanks man. That worked. I had '$datedata' and I was getting errors. Removed the '' and all is good!

Thanks.

Dismounted 08-09-2008 07:16 AM

In vBulletin, you should use vbdate() instead of date(). See the API Documentation.

Opserty 08-09-2008 07:18 AM

Quote:

I have an external script that pulls information form the vBulletin Databases so using the vB Datamangers is not an option.
:p



(Damn vBulletin character count...).

Dismounted 08-09-2008 07:33 AM

I was just meaning to say if. :p


All times are GMT. The time now is 05:01 PM.

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.01087 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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