Timezone Asia/Jerusalem incorrectly listed under UTC-0
Open, Needs TriagePublic

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:

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

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.

avivey added a subscriber: avivey.Feb 16 2017, 10:27 PM

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.