JosephMajaseSithole / datejs

Automatically exported from code.google.com/p/datejs
0 stars 0 forks source link

ParseExact treats UTC offset as time #65

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. ParseExact("2009-03-05T23:00:00-08:00","yyyy-MM-ddTHH:mm:ss-hh:mm")
2.
3.

What is the expected output? What do you see instead?
Returns a time of 08:00 (Thu Mar 5 08:00 PST 2009).  Offset being parsed 
as the time.

What version of the product are you using? On what operating system?
Windows XP SP. IE 6.  Version: 1.0 Alpha-1

Please provide any additional information below.

Original issue reported on code.google.com by tj.his...@gmail.com on 5 Mar 2009 at 7:42

GoogleCodeExporter commented 8 years ago
This is due to using the wrong format! The hh:mm says that this is supposed to 
be the hour and minute!

The correct format would be the following: 
Date.parseExact("2009-03-05T23:00:00-08:00","yyyy-MM-ddTHH:mm:ssz")

Original comment by darkcr...@gmail.com on 16 Sep 2013 at 1:38