mde / timezone-js

DEPRECATED: Timezone-enabled JavaScript Date object. Uses Olson zoneinfo files for timezone data.
824 stars 183 forks source link

Getting different results from the string constructor #54

Closed hnadra closed 4 years ago

hnadra commented 11 years ago

My local time is "America/Chicago" (UTC-06:00).

new timezoneJS.Date(2013, 00, 01, "America/New_York").getTime() => 1357016400000 (correct) but: new timezoneJS.Date("01/01/2013", "America/New_York").getTime() => 1357020000000 (incorrect)

Also: new timezoneJS.Date(2013, 00, 01, "America/Los_Angeles").getTime() => 1357027200000 (correct) but: new timezoneJS.Date("01/01/2013", "America/Los_Angeles").getTime() => 1357020000000 (incorrect)