Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 10 Aug 2017, 10:01
xman2014 xman2014 is offline
 
Join Date: Jan 2015
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 10 Aug 2017, 15:05
Dave Dave is online now
 
Join Date: Jun 2010
Real name: Dave
Are you sure the time on your actual server (NTP) is not running behind?
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #3  
Old 10 Aug 2017, 19:22
Stingray27 Stingray27 is offline
 
Join Date: Jan 2006
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 10 Aug 2017, 19:23
xman2014 xman2014 is offline
 
Join Date: Jan 2015
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 10 Aug 2017, 19:26
Stingray27 Stingray27 is offline
 
Join Date: Jan 2006
Originally Posted by xman2014 View Post
how can i fix it
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 11 Aug 2017, 08:33
xman2014 xman2014 is offline
 
Join Date: Jan 2015
who can make a plugin for me to fix timezone issue on vb4.2.5?
please help me
Reply With Quote
  #7  
Old 11 Aug 2017, 11:46
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
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.
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 11 Aug 2017 at 13:27 ---------------

OK it seems:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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 11 Aug 2017 at 15:27 ---------------

OK,

functions.php in the /includes/ directory.

Line 4503:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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 11 Aug 2017 at 15:40 ---------------

So my final determination is to simply change


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.
__________________
-Joe (@BirdOPrey5) Former Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.

Last edited by BirdOPrey5; 11 Aug 2017 at 13:16. Reason: making progress
Reply With Quote
  #8  
Old 11 Aug 2017, 19:04
xman2014 xman2014 is offline
 
Join Date: Jan 2015
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 11 Aug 2017 at 13:27 ---------------

OK it seems:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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 11 Aug 2017 at 15:27 ---------------

OK,

functions.php in the /includes/ directory.

Line 4503:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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 11 Aug 2017 at 15:40 ---------------

So my final determination is to simply change


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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 12 Aug 2017, 16:52
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
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?
__________________
-Joe (@BirdOPrey5) Former Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #10  
Old 12 Aug 2017, 20:47
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
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.
__________________

Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #11  
Old 13 Aug 2017, 18:05
xman2014 xman2014 is offline
 
Join Date: Jan 2015

i set timezone to +5.30 but its disply +5. only
time is working fine after change from
$tzos = intval($vbulletin->userinfo['timezoneoffset']);
to
$tzos = floatval($vbulletin->userinfo['timezoneoffset']);
but timezone steel not working fine
Reply With Quote
  #12  
Old 14 Aug 2017, 01:34
Stingray27 Stingray27 is offline
 
Join Date: Jan 2006
Originally Posted by xman2014 View Post
but timezone steel not working fine
More than one change
Originally Posted by Paul M View Post
the fix would probably be to update all the changes to use floatval.
Reply With Quote
  #13  
Old 14 Aug 2017, 23:34
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
You may need to re-choose the timezone from the settings as well.
__________________
-Joe (@BirdOPrey5) Former Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #14  
Old 15 Aug 2017, 19:31
xman2014 xman2014 is offline
 
Join Date: Jan 2015
Originally Posted by BirdOPrey5 View Post
You may need to re-choose the timezone from the settings as well.
i re-choose timezone but steel show +5. only not +5.30
same issue like time, timezone not display +-30 and +-45
Reply With Quote
  #15  
Old 16 Aug 2017, 03:16
Stingray27 Stingray27 is offline
 
Join Date: Jan 2006
Its just a display, you are worrying about it too much, that display doesnt do anything else.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shy Style 4 ...AFC Asia Cup 2007(Mr.Asia) alawee.blawee vBulletin 3.6 Styles 2 06 Jul 2007 17:15



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 17:25.

Layout Options | Width: Wide Color: