In short, this library doesn't do a lot but saves you a lot of troubles. It returns the standard time offset of the user's browser. From there, you can narrow the list of possible time zones for a user. To have the standard timezone offset simple call :
var standardOffset = jsKata.timezone.st(); /* or you can also call a shorter version */ standardOffset = jsk.tz.st();
You can see a demo.
// Return the daylight saving time offset var daylightSavingOffset = jsKata.timezone.dst(); // If the time zone has daylight saving jsk.tz.hasDst(); // Return the standard time zone as a string (ex : -0500) jsk.tz.stToString(); // Return the daylight saving time zone as a string (ex : -0400) jsk.tz.dstToString();
In winter, it's always standard time. In summer, it's daylight saving time which is standard time minus 60 minutes… but not for every country. Plus, summer and winter are inverted in the southern hemisphere. That's a lot of exceptions and that's why I created the jsKata.timezone library.