View Full Version : What variable holds the current localtimezone for vB?
stardotstar
05-22-2009, 05:26 AM
When displaying the post details what is the timezone set under?
date_default_timezone_get();
if this is right, does it incorporate the user's local zone as set in their UCP or is that another?
I have a plugin which is blowing a localtime back to UTC and yet the main board at the bottom of the page is undisturbed.
Appreciated
Wil
Dismounted
05-22-2009, 10:09 AM
All times in the database are stored in UTC and are only offset when displayed. The variable that holds the offset is:
$vbulletin->userinfo['timezoneoffset']
stardotstar
05-22-2009, 10:16 AM
Thank you for that - I will add it to my searching on this problem I have:
It seems for the purposes that I am troubleshooting I need to know how the timestamp for posts and pms and other items displayed are rendered back at UTC while the main board time is correctly displayed at the bottom of the board...
eg
All times are GMT +10. The time now is 21:11.
but at post at that time on the same page shows as
11:11 AM UTC
This is after a callout via a product to openx which has a bug that resets the php variable to UTC when called in a particular mode (local mode) but with javascript (soooo slooooow) works fine.
I am asking this question in various ways because I want to fix the phpadsnew integration (currently not being supported and at vb3.5) and all I need is the workaround to save the local timezone that is used to build the display date and then reset it after the call out but I am still learning (as fast as I can)
Thank you for the reply and to anyone else who can help me hack through to the next level of this project and my own skills as a php hack :)
Will
Andreas
05-23-2009, 01:02 PM
Hmm ... doing a OpenX call really should not affect the display of timestamps.
Are you 100% sure if is caused by that call?
Can you post some code?
stardotstar
05-25-2009, 05:38 AM
As complete a description of my problem as I have been able to word it is here:
https://vborg.vbsupport.ru/showthread.php?t=214190
And I got further with the "bug" that supposedly causes it in openx:
https://vborg.vbsupport.ru/showthread.php?t=214252
In summary; if I have the code to call a localmode banner from openx all my times display in UTC (Except the one at the bottom of the pages which quotes the current time (it is both correct and showing the correct zone) The time is right - just shifted back to UTC (Board is set to +10 and most of my users are too.) Server time is ok as confirmed by many tests.
If I take the code out of the template system the system goes back to normal.
Have a look at my board comparing these two user selectable (guest) styles
http://www.archeli.com.au/forums
arcBLUE
arcLEAN
and you will see immediately what I mean. I added the tz syntax to the board time display to help give the users confidence that it is not a fault with the clock.
It seems that it is some kind of zone setting that openx causes whenever local mode is used - with javascript it is fine but soooo sloooooow...
Best regards and thanks in advance for any help
Will
[update]
Just turning on debug mode I see the following (shows the openx includes)
Included Files:
* ./index.php
* ./global.php
* ./includes/init.php
* ./includes/class_core.php
* ./includes/config.php
* ./includes/functions.php
* ./includes/class_hook.php
* .//var/www/sourcepoint/htdocs/openx/phpadsnew.inc.php
* .//var/www/sourcepoint/htdocs/openx/init-delivery.php
* .//var/www/sourcepoint/htdocs/openx/init-delivery-parse.php
* .//var/www/sourcepoint/htdocs/openx/memory.php
* .//var/www/sourcepoint/htdocs/openx/variables.php
* .//var/www/sourcepoint/htdocs/openx/lib/max/Delivery/common.php
* .//var/www/sourcepoint/htdocs/openx/lib/max/Delivery/cookie.php
* .//var/www/sourcepoint/htdocs/openx/lib/max/Delivery/remotehost.php
* .//var/www/sourcepoint/htdocs/openx/lib/max/Delivery/log.php
* .//var/www/sourcepoint/htdocs/openx/lib/max/Dal/Delivery.php
* .//var/www/sourcepoint/htdocs/openx/lib/max/Delivery/tracker.php
* .//var/www/sourcepoint/htdocs/openx/lib/max/Delivery/cache.php
* .//var/www/sourcepoint/htdocs/openx/lib/OA.php
* .//var/www/sourcepoint/htdocs/openx/lib/pear/Log.php
* .//var/www/sourcepoint/htdocs/openx/lib/pear/PEAR.php
* .//var/www/sourcepoint/htdocs/openx/var/plugins/cache/mergedDeliveryFunctions.php
* .//var/www/sourcepoint/htdocs/openx/plugins/deliveryLimitations/Client/initClientData.delivery.php
* .//var/www/sourcepoint/htdocs/openx/lib/OA/Dal/Delivery/mysql.php
* .//var/www/sourcepoint/htdocs/openx/lib/max/Delivery/adSelect.php
* .//var/www/sourcepoint/htdocs/openx/lib/max/Delivery/limitations.php
* .//var/www/sourcepoint/htdocs/openx/lib/max/Delivery/adRender.php
* .//var/www/sourcepoint/htdocs/openx/plugins/deliveryCacheStore/oxMemcached/oxMemcached.delivery.php
* .//var/www/sourcepoint/htdocs/openx/plugins/deliveryDataPrepare/oxDeliveryDataPrepare/dataCommon.delivery.php
* .//var/www/sourcepoint/htdocs/openx/plugins/deliveryLog/oxLogRequest/logRequest.delivery.php
* .//var/www/sourcepoint/htdocs/openx/plugins/deliveryAdRender/oxMarketDelivery/oxMarketDelivery.delivery.php
* ./chat/temp/config.srv.php
* ./chat/inc/langs/en.php
* ./includes/functions_bigthree.php
* ./includes/functions_forumlist.php
* ./includes/functions_calendar.php
* ./photoplog/thumbnails.php
* ./includes/photoplog_prefix.php
* ./photoplog/permissions.php
* ./includes/adminfunctions.php
* ./photoplog/functions.php
* ./includes/functions_newpost.php
* ./includes/blog_functions_shared.php
Hooks Called:
* init_startup
* fetch_userinfo_query
* fetch_musername
* fetch_userinfo
* cache_permissions
* style_fetch
* cache_templates
* global_start
* parse_templates
* notifications_list
* global_setup_complete
* forumhome_start
* forumhome_loggedinuser_query
* forumhome_loggedinuser
* cache_ordered_forums
* forumbit_display
* forumbit_subforumbit
* forumbit_subforumbit2
* forumhome_complete
* photoplog_thumbnails_start
* photoplog_thumbnails_sortsql_random
* photoplog_functions_filelink
* photoplog_thumbnails_minithumbpics
* photoplog_thumbnails_minithumbnails
* photoplog_thumbnails_sortsql_new
* photoplog_thumbnails_thumbpics
* photoplog_thumbnails_thumbnails
* photoplog_thumbnails_complete
I have tried changing the execution order of the two plugins for phpadsnew integration; also the hook location but to no avail.
Any and all ideas or suggestions are most appreciated.
\\'
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.