PDA

View Full Version : Interpreting date fields...


mriley
Fri 22nd Sep '06, 2:28pm
What is the best way to convert the date values stored within the VB database into an actual date value? I see the date type is an int(10) field. I have exported some of the data, but would like to convert into an actual datetime value...
thanks.

nico_swd
Fri 22nd Sep '06, 2:45pm
If you want to do that inside vBulletin, you can use its vbdate() function.


echo vbdate('dS M Y', $row['dateline']);


If you want to use it somewhere else you can use PHP's date() function.

echo date('dS M Y', $row['dateline']);


http://us2.php.net/manual/en/function.date.php

(See the first table for the date format possibilities)

mriley
Fri 22nd Sep '06, 5:08pm
Hi,
thanks for the reply. I was actually looking to do it with SQL against the db itself...Will have to check the MYSQL reference.

Lats
Fri 22nd Sep '06, 10:53pm
Try something like this...
SELECT
username,
from_unixtime(joindate, '%d %m %Y')
FROM
user

That shows, in human readable form, when a user joined up.

Reeve of Shinra
Sun 15th Oct '06, 12:15am
If you exported your data into excel (or another spreadsheet), you can use this

=DATE(1970,1,1) + A1/86400
where A1 is the cell with the unix time stamp.