vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Wrong timing. =S (https://vborg.vbsupport.ru/showthread.php?t=58537)

Red Blaze 11-11-2003 05:23 PM

Wrong timing. =S
 
Ok, here's my question...
PHP Code:

                $date $get["date"];
                
$date date("Y")."-".substr($date,1,2)."-".substr($date,4,2)." ".substr($date,7,2).":".substr($date,10,2);
                
$date date("[m/d|g:i a]",strtotime($date)+(($bbuserinfo['timezoneoffset']+5)*3600)); 


I have that code is a php file (doy) :nervous:
My time comes out wrong. What I mean is this...


I copy pasted this from one of my vb pages.

The time now is 01:24 PM.

When I posted on a chat box it said that it was 6:24 pm. Help me please.


EDIT: Nevermind, I barely found the problem. -__-;;; I just thought of algebra and I added +5 to MY timezoneoffset. I erased the +5 and fixed it. Sorry about this. Shows how new I am to PHP. =/

Velocd 11-12-2003 07:27 PM

Instead of using the strtotime() function to convert one date string into a new date string, the more conventional method is simply using a timestamp for the first date.

That is why the vBulletin tables, and most DB tables, store timestamp values instead of date string values. They may not be easier to read from directly inside the DB, but they're easier to manipulate in PHP.


All times are GMT. The time now is 02:34 AM.

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.01493 seconds
  • Memory Usage 1,712KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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