Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-10-2017, 07:01 AM
xman2014 xman2014 is offline
 
Join Date: Jan 2015
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default asia/kolkata timezone not work after update 4.2.5

i upgrade my forum with 4.2.5
i am from india and after update timezone show incorrect time
my forum timezone set to +5.30 asia/kolkata but display +5. only
my forum time running delay by 30 minutes
please tell me how can i fix it
Reply With Quote
  #2  
Old 08-10-2017, 12:05 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure the time on your actual server (NTP) is not running behind?
Reply With Quote
  #3  
Old 08-10-2017, 04:22 PM
Stingray27 Stingray27 is offline
 
Join Date: Jan 2006
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You cannot, its basically a bug.

The changes made for php7 mean it will only work with whole hours, not 0.5 hours.
Reply With Quote
  #4  
Old 08-10-2017, 04:23 PM
xman2014 xman2014 is offline
 
Join Date: Jan 2015
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stingray27 View Post
You cannot, its basically a bug.

The changes made for php7 mean it will only work with whole hours, not 0.5 hours.
how can i fix it, please help me, i have 2 forum. i have same issue on both forum
Reply With Quote
  #5  
Old 08-10-2017, 04:26 PM
Stingray27 Stingray27 is offline
 
Join Date: Jan 2006
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by xman2014 View Post
how can i fix it
Quote:
Originally Posted by Stingray27 View Post
You cannot, its basically a bug.
It would need core code changes in multiple places I think
Reply With Quote
  #6  
Old 08-11-2017, 05:33 AM
xman2014 xman2014 is offline
 
Join Date: Jan 2015
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

who can make a plugin for me to fix timezone issue on vb4.2.5?
please help me
Reply With Quote
  #7  
Old 08-11-2017, 08:46 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stingray27 View Post
You cannot, its basically a bug.

The changes made for php7 mean it will only work with whole hours, not 0.5 hours.
Quote:
Originally Posted by Stingray27 View Post
It would need core code changes in multiple places I think
I'm looking at the code and comparing it to VB 4.2.3 which I assume worked, but all the code I see had hard coded multiplying the offset by 3600 (which is # of seconds in an hour 60*60) so I don't understand where partial hours come into the code.

Can anyone confirm the last version timezones worked correctly? Did they work in 4.2.4?

VB.com thread- https://www.vbulletin.com/forum/foru...r-update-4-2-5 (in case we get a fix.)

EDIT- I have confirmed the partial hours DO work in VB 4.2.4.

--------------- Added [DATE]1502454435[/DATE] at [TIME]1502454435[/TIME] ---------------

OK it seems:

PHP Code:
$vbulletin->userinfo['tzoffset'
is being forced to be an int somewhere in VB 4.2.5.

In VB 4.2.4 it can be a float. 30 minutes would be like 4.5 and 45 minutes would be like 6.25

Still checking code for fix.

--------------- Added [DATE]1502461642[/DATE] at [TIME]1502461642[/TIME] ---------------

OK,

functions.php in the /includes/ directory.

Line 4503:

Code:
$tzos = intval($vbulletin->userinfo['timezoneoffset']);
If you remove intval from the code, the time works (you have to set the timezone again after making this change.

It works in the forum and posts. It does NOT work on calendar events, for some reason there are additional intval() functions in the calculator.

I'm going to look deeper into the security ramifications of removing the intval function from this line but a quick glace I see no problem.

--------------- Added [DATE]1502462449[/DATE] at [TIME]1502462449[/TIME] ---------------

So my final determination is to simply change

Code:
$tzos = intval($vbulletin->userinfo['timezoneoffset']);
to

Code:
$tzos = floatval($vbulletin->userinfo['timezoneoffset']);
on line 4503 of /includes/functions.php to get the time working on most of the site.

Unfortunately I don't see any way to make this a plugin, the manual edit it necessary.
Reply With Quote
  #8  
Old 08-11-2017, 04:04 PM
xman2014 xman2014 is offline
 
Join Date: Jan 2015
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
I'm looking at the code and comparing it to VB 4.2.3 which I assume worked, but all the code I see had hard coded multiplying the offset by 3600 (which is # of seconds in an hour 60*60) so I don't understand where partial hours come into the code.

Can anyone confirm the last version timezones worked correctly? Did they work in 4.2.4?

VB.com thread- https://www.vbulletin.com/forum/foru...r-update-4-2-5 (in case we get a fix.)

EDIT- I have confirmed the partial hours DO work in VB 4.2.4.

--------------- Added [DATE]1502454435[/DATE] at [TIME]1502454435[/TIME] ---------------

OK it seems:

PHP Code:
$vbulletin->userinfo['tzoffset'
is being forced to be an int somewhere in VB 4.2.5.

In VB 4.2.4 it can be a float. 30 minutes would be like 4.5 and 45 minutes would be like 6.25

Still checking code for fix.

--------------- Added [DATE]1502461642[/DATE] at [TIME]1502461642[/TIME] ---------------

OK,

functions.php in the /includes/ directory.

Line 4503:

Code:
$tzos = intval($vbulletin->userinfo['timezoneoffset']);
If you remove intval from the code, the time works (you have to set the timezone again after making this change.

It works in the forum and posts. It does NOT work on calendar events, for some reason there are additional intval() functions in the calculator.

I'm going to look deeper into the security ramifications of removing the intval function from this line but a quick glace I see no problem.

--------------- Added [DATE]1502462449[/DATE] at [TIME]1502462449[/TIME] ---------------

So my final determination is to simply change

Code:
$tzos = intval($vbulletin->userinfo['timezoneoffset']);
to

Code:
$tzos = floatval($vbulletin->userinfo['timezoneoffset']);
on line 4503 of /includes/functions.php to get the time working on most of the site.

Unfortunately I don't see any way to make this a plugin, the manual edit it necessary.
Thanks its work for me.
now time is working perfect but timezone steel show +5
i want to display timezone +5.30
Reply With Quote
  #9  
Old 08-12-2017, 01:52 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by xman2014 View Post
Thanks its work for me.
now time is working perfect but timezone steel show +5
i want to display timezone +5.30
Where is it displaying this? Screenshot?
Reply With Quote
  #10  
Old 08-12-2017, 05:47 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its a bug.

The code was changed in multiple places due to changes in php 7.1
Unfortunately it wasnt realised that some timezones use 0.5 hours, so intval was used.

This issue wasnt noticed until now, so too late to fix.
As above, the fix would probably be to update all the changes to use floatval.
Reply With Quote
Благодарность от:
TheLastSuperman
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:23 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11443 seconds
  • Memory Usage 2,278KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (2)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete