user1338413
user1338413

Reputation: 2551

compare date-strings with timezone

I have a date-string like this:

2013-01-04T15:55:51.217+01:00

I can get a date like this:

2013-01-04T15:55:51

with SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").

But cant find something for the whole date-string with the milliseconds and Timezone.

Upvotes: 0

Views: 1663

Answers (2)

Sujith Surendranathan
Sujith Surendranathan

Reputation: 2579

Try this:

SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss:SSS z")

Also, take a look at this (I am assuming you are using Java 6)

Upvotes: 0

Zylth
Zylth

Reputation: 217

Try SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX")

Upvotes: 1

Related Questions