vb.org Archive

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

Boofo 08-10-2002 11:00 AM

Time Offset
 
Can anyone please tell me how to set the timezoneoffset for the following lines of code? I have tried to figure it out with no success. :(

PHP Code:

 $time_lastup strtotime($weatherdata[lastup]);
  
$weather[updatedate] = vbdate($dateformat,$time_lastup);
  
$weather[updatetime] = vbdate($timeformat,$time_lastup); 


Xenon 08-10-2002 12:29 PM

$time_lastup+=($bbuserinfo['timezoneoffset']-$timeoffset)*3600

Boofo 08-10-2002 12:40 PM

Thank you, sir. ;)

So it should look like this when I am done, right?

PHP Code:

$time_lastup strtotime($weatherdata[lastup]);
  
$weather[updatedate] = vbdate($dateformat,$time_lastup+=($bbuserinfo['timezoneoffset']-$timeoffset)*3600);
  
$weather[updatetime] = vbdate($timeformat,$time_lastup+=($bbuserinfo['timezoneoffset']-$timeoffset)*3600); 


Quote:

Originally posted by Xenon
$time_lastup+=($bbuserinfo['timezoneoffset']-$timeoffset)*3600

Xenon 08-10-2002 12:52 PM

no, put the code i gave you in a new line after the first line

Boofo 08-10-2002 01:03 PM

Like this?

PHP Code:

  $time_lastup strtotime($weatherdata[lastup]);
  
$time_lastup+=($bbuserinfo['timezoneoffset']-$timeoffset)*3600
  $weather
[updatedate] = vbdate($dateformat,$time_lastup);
  
$weather[updatetime] = vbdate($timeformat,$time_lastup); 

Does there have to be a semi-colon at the end of the new line?

Xenon 08-12-2002 12:47 AM

of course there have to be a ; ;)

and yes this should be correct now

Erwin 08-12-2002 10:07 PM

That's for JR's weather hack. :) Does it work Boofo?

Boofo 08-13-2002 07:11 PM

For some reason, it isn't working quite right. It changes the time OK, but now instead of being at the server time, it is 6 hours behind the server now. The server is set at GMT and my timeoffset is at -6. The weather time is showing up 12 hours behind me now instead of 6 hours behind like before. Any ideas on this one, buddy? :)

Xenon 08-13-2002 10:44 PM

hmm, try to replace all + with an - and all - with an +

Boofo 08-13-2002 11:14 PM

Here's the code with the changes you suggested.

PHP Code:

$time_lastup strtotime($weatherdata[lastup]);
  
$time_lastup-=($bbuserinfo['timezoneoffset']+$timeoffset)*3600;
  
$weather[updatedate] = vbdate($dateformat,$time_lastup);
  
$weather[updatetime] = vbdate($timeformat,$time_lastup); 

It almost works. The time is showing (when logged in) at 1/2 hour ahead of my time. At 7:10 pm it shows 7:40 pm. But when logged out it shows 11 1/2 hours behind. It shows yesterday at 7:40 pm when it is today at 7:10 pm.

Quote:

Originally posted by Xenon
hmm, try to replace all + with an - and all - with an +


All times are GMT. The time now is 06:31 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.01379 seconds
  • Memory Usage 1,743KB
  • 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
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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