jskata.timezone

dsimard edited this page Oct 19, 2010 · 3 revisions

jsKata.timezone

Returns standard and daylight saving time zones based on the user's browser

Read more at http://www.javascriptkata.com/2010/10/14/auto-detect-timezones-time-zone-offsets-and-daylight-saving-in-javascript/

Functions

hasDst() : boolean

Returns if the timezone has daylight saving time.

st() : integer

Returns the standard time offset of the timezone in seconds. Example, North America/Eastern Time returns -300.

stToString(timeSeparator) : integer

Returns the standard time offset of the timezone in hour. Example, North America/Eastern Time returns -0500.

timeSeparator string : Time separator (":" would return -05:00)

dst() : integer

Returns the daylight saving time offset of the timezone in seconds. Example, North America/Eastern Time returns -240.

timeSeparator string : Time separator (":" would return -05:00)

dstToString(timeSeparator) : integer

Returns the daylight saving time offset of the timezone in hour. Example, North America/Eastern Time returns -0400.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.