keithamus / tempus

Tempus - Time for a new Date()
http://tempus-js.com
Other
94 stars 9 forks source link

Tempus parsing of ISO8601 strings loses a day #19

Open mikesten opened 12 years ago

mikesten commented 12 years ago

I think there's a bug in the parsing of ISO 8601 date strings. I tried the following in my Chrome console:

var t = Tempus() t.toISO8601String() "2012-06-28T00:24:49.883+0100" var u = Tempus("2012-06-28T00:24:49.883+0100") u.toISO8601String() "2012-06-27T00:24:49.883+0100"

We've lost a day...

giacecco commented 11 years ago

What you describe does not happen to me with the latest Tempus at the moment of writing. I have used a Chrome console, too.

keithamus commented 11 years ago

0.1 is heavily broken with timezones. Try using master, although master is not perfect (it is a pre-0.2 build). This is one of the big things I want to properly address for 0.2.