开发者

How parse this 2009-05-12T13:40:00Z to java date [duplicate]

This question already has answers here: What's the best way to 开发者_JS百科parse an XML dateTime in Java? (9 answers) Closed 6 years ago.

what's the best way to parse this string 2009-05-12T13:40:00Z to a valid java date? I'm not sure for what "T" and "Z" stands for - i guess Z means zulu?

Thanks, Joo


The format string you have is a UTC date/time in the ISO 8601 format. The format is simply the date, a T separator and the UTC time (or zulu time).

java.text.SimpleDateFormatter should perform all the parsing you need.


Note that the patter has some special handling for internal static values like 'T':

See the answer here Illegal pattern character 'T' when parsing a date string to java.util.Date

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜