This is a migrated thread and some comments may be shown as answers.

Problem with Timezone

1 Answer 124 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Matt Dufrasne
Top achievements
Rank 1
Matt Dufrasne asked on 09 Oct 2013, 11:31 PM
Using 2013.9.18

I'm defining a kendoScheduler with 
timezone: "Etc/UTC"
It works great, in my database the times are stored in UTC and depending on whether I load the page in San Francisco (GMT+7) or Minneapolis (GMT+5), the same event shows two different starting times depending on the user's geographical location. The kendoScheduler seems to convert the dates to local time and this is great for me. (The documentation indicates it should do the opposite, but this is the effect I wanted so for now I'm happy).

The problem is that it computes local time wrong. In Minneapolis, it takes GMT and adds 5 and in San Francisco, it takes GMT and adds 7. It should be subtracting these values, not adding them! If it's 00:00 GMT, it's 17:00 the previous day in San Francisco, not 07:00.

Has anyone else had the same sort of issues? Searching the forums, it seems like I'm not the only one encountering this.



1 Answer, 1 is accepted

Sort by
0
Matt Johnson
Top achievements
Rank 1
answered on 10 Oct 2013, 02:13 AM
You should not be using zones like "Etc/GMT+5" or "Etc/GMT+7".  Instead, you should be using zones like "America/Chicago" or "America/Los_Angeles".

Kendo uses the IANA time zone database.  The GMT zones in that database have their sign inverted intentionally.  They are only there for backwards compatibility with POSIX time zones.  They are completely unnecessary for JavaScript.

You can read more in the comments in the timezone database itself.
https://github.com/eggert/tz/blob/master/etcetera
Tags
Calendar
Asked by
Matt Dufrasne
Top achievements
Rank 1
Answers by
Matt Johnson
Top achievements
Rank 1
Share this question
or