PDA

View Full Version : vbulletin conversion


dinozz
09-22-2002, 11:07 AM
hi,
i've the following problem:
Date and hour i see with vbulletin program (e.g.: 2002-02-22 18:51:19) become strange numbers in phpmyadmin and other database import programs (e.g.: the date above becomes 1014421901).
Can you explain me how can I reconvert the number 1014421901 in date and hour?

what is the operation that is made to transform the date and hour in this ten digit number?

Thank you for your help

Xenon
09-22-2002, 11:40 AM
to reconvert a unixtimestamp use date()

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

Eagle Creek
05-12-2006, 08:07 PM
to reconvert a unixtimestamp use date()

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

Hi Xenon,

can I ask why vB is using this time stamp?

I'm now reading your link, and more information about it. Thankyou!

Marco van Herwaarden
06-17-2006, 10:33 AM
First of all, those strange looking numbers are Unix-style datetime-stamps. It is the number of seconds since the Unix-epoch.

Ofcourse you can write your own formatting using standard PHP-functions. When used in a vB environment it is however better to use vbdate() as provided in includes/functions.php.

Examples:
$MyFormattedDate = vbdate($vbulletin->options['dateformat'], $postinfo['dateline']);
$MyFormattedTime = vbdate($vbulletin->options['timeformat'], $postinfo['dateline']);


$vbulletin->options['dateformat'] points to the different date and time formats you can set in AdminCP->vBulletin Options->Date and Time Options

If you use this technique you can make sure that dates and times are consistently formatted on your board.