java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -


i trying parse date 2014-12-03t10:05:59.5646+08:00 using these 2 formats:

  • yyyy-mm-dd't'hh:mm:ss
  • yyyy-mm-dd't'hh:mm:ssxxx

when parse using yyyy-mm-dd't'hh:mm:ss works fine, when parse yyyy-mm-dd't'hh:mm:ssxxx parseexception thrown.

which correct format parse date , difference between these 2 formats?

note : cannot use joda :(

those valid formats:

yyyy-mm-dd't'hh:mm:ss.sssz       >>>  e.g.: 2001-07-04t12:08:56.235-0700  yyyy-mm-dd't'hh:mm:ss.sssxxx     >>>  e.g.: 2001-07-04t12:08:56.235-07:00 

edit:
btw, "x" refer (iso 8601 time zone)


Comments

Popular posts from this blog

c# - Get rid of xmlns attribute when adding node to existing xml -