View Full Version : Convert Data Field to Real Date
CypherSTL
08-08-2008, 09:54 PM
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
http://php.net/date
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?
// $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
What is your current 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 (http://members.vbulletin.com/api/).
Opserty
08-09-2008, 07:18 AM
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
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.