vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   vbulletin conversion (https://vborg.vbsupport.ru/showthread.php?t=43808)

dinozz 09-22-2002 11:07 AM

vbulletin conversion
 
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

Quote:

Originally Posted by Xenon
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:
PHP Code:

$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.


All times are GMT. The time now is 02:41 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.01123 seconds
  • Memory Usage 1,719KB
  • 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_php_printable
  • (1)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