Trying to parse the following timestamp:
2008-09-19T19:05:30.000Z
However I am getting a parseException. Is anyone aware of a class or SimpleDateFormat that could take care of this?
What I am using now in Scala (Java answers work, too):
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.Z")
Thanks for your help.
And single quotes (
') around theZ. This instructs the parser to treatZas a constant character (just like theT). Also add inSSSfor the milliseconds. Thus your pattern would beyyyy-MM-dd'T'HH:mm:ss.SSS'Z'