Page MenuHomePhabricator

Timezone Asia/Jerusalem incorrectly listed under UTC-0
Closed, ResolvedPublic

Description

Issue started to happen after upgrading to stable version "2017 Week 2"

This is reported by our Israel team, they sometimes got the following prompt:

Screen Shot 2017-02-13 at 14.51.31.png (69×355 px, 13 KB)

When that happens, they check their phabricator timezone setting, and found out that Asia/Jerusalem listed under UTC-0 (should be UTC+2 instead)

Screen Shot 2017-02-14 at 9.10.32.png (730×395 px, 107 KB)

This is not consistent, they mentioned the error would pop up occasionally, when it pops up, Asia/Jerusalem is listed under UTC-0; and when it's not, it's correctly under UTC+2.

Not sure if this is a new bug in phabricator code, or something wrong with my server side setting, but the issue starts to happen after upgrade.

Event Timeline

This information is obtained from your PHP, using datetimezone.getoffset(), so it's not all in our control.

It appears that getoffset is trying to take into account daylight-savings time, (But that's not active right now, and also would make the time UTC +3 instead).

  • Do you have a special version of php? Maybe a very old one?

I'm not sure how php get's its DST information, but maybe that's the part that's broken (That information needs to be updated routinely).

err, looks like it returns "FALSE on failure", and naturally in PHP, FALSE / 3600 is 0, so we just consider it as "UTC".

Well by the time you divide false into 3600 pieces you can't have much left!

@avivey Thanks! my php version is PHP 5.5.9, would you recommend upgrading? I didn't find anything in my php error log though, any suggestion where else I could look into to find out the cause?

I wouldn't expect anything in the logs; You can try running a script and running something like this:

$d = new DateTimeZone("Asia/Jerusalem");
var_dump($d->getOffset(new DateTime('@'.time())));

IF you're getting back FALSE, then it's definitely this.

5.5.9 doesn't sound that old, but 5.5.10 notes lists a fix for this bug:

Fixed bug #44780 (some time zone offsets not recognized by timezone_name_from_abbr)

The bug tracker is down though, so I don't know if it's related.

It might make sense to upgrade anyway if you can easily do so - there are 3 more years of bugs since 5.5.9 came out.

@avivey I no longer run into this problem, please feel free to close this bug.

avivey claimed this task.

We need a "Resolved: Ghosts" status.

We still do some wrong things for time zones which aren't whole hour, like India (UTC+5:30), Central Australia (UTC+9:30) and Nepal (UTC+5:45), but I guess nobody noticed yet.