vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=325494

asia/kolkata timezone not work after update 4.2.5
by xman2014
10 Aug 2017 09:01

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

Dave 10 Aug 2017 14:05

Are you sure the time on your actual server (NTP) is not running behind?

Stingray27 10 Aug 2017 18:22

You cannot, its basically a bug.

The changes made for php7 mean it will only work with whole hours, not 0.5 hours.

xman2014 10 Aug 2017 18:23

Quote:

Originally Posted by Stingray27 (Post 2589264)
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

Stingray27 10 Aug 2017 18:26

Quote:

Originally Posted by xman2014 (Post 2589265)
how can i fix it

Quote:

Originally Posted by Stingray27 (Post 2589264)
You cannot, its basically a bug.

It would need core code changes in multiple places I think

xman2014 11 Aug 2017 07:33

who can make a plugin for me to fix timezone issue on vb4.2.5?
please help me

BirdOPrey5 11 Aug 2017 10:46

Quote:

Originally Posted by Stingray27 (Post 2589264)
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 (Post 2589267)
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 12: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 14: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 14: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.

xman2014 11 Aug 2017 18:04

Quote:

Originally Posted by BirdOPrey5 (Post 2589279)
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 12: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 14: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 14: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

BirdOPrey5 12 Aug 2017 15:52

Quote:

Originally Posted by xman2014 (Post 2589287)
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?

Paul M 12 Aug 2017 19:47

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.

xman2014 13 Aug 2017 17:05

https://www.vbulletin.org/forum/external/2017/08/3.png
i set timezone to +5.30 but its disply +5. only
time is working fine after change from
Quote:

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

$tzos = floatval($vbulletin->userinfo['timezoneoffset']);
but timezone steel not working fine

Stingray27 14 Aug 2017 00:34

Quote:

Originally Posted by xman2014 (Post 2589328)
but timezone steel not working fine

More than one change
Quote:

Originally Posted by Paul M (Post 2589310)
the fix would probably be to update all the changes to use floatval.


BirdOPrey5 14 Aug 2017 22:34

You may need to re-choose the timezone from the settings as well.

xman2014 15 Aug 2017 18:31

Quote:

Originally Posted by BirdOPrey5 (Post 2589350)
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

Stingray27 16 Aug 2017 02:16

Its just a display, you are worrying about it too much, that display doesnt do anything else.


All times are GMT. The time now is 07:35.

Powered by vBulletin® Version 3.8.14
Copyright © 2022, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.