Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
7 events
when toggle format what by license comment
Mar 4, 2014 at 0:05 comment added Ted M. Young If only one X is used, you'll get a truncated time zone, e.g., 2014-03-03-T16:00:00-08. From my reading of docs.oracle.com/javase/7/docs/api/java/text/… (and testing), you want XXX in order to get a properly formatted time zone (at least in terms of what the OP points to, specifically section 3.2.7.3), e.g., "yyyy-MM-dd'T'HH:mm:ssXXX", which gives you 2014-03-03-T16:00:00-08:00. Note the colon-separated time zone info.
May 16, 2012 at 14:31 comment added assylias @PNS You are right - amended.
May 16, 2012 at 14:31 history edited assylias CC BY-SA 3.0
deleted 4 characters in body
May 16, 2012 at 14:24 comment added PNS The correct pattern for the date example of this question should probably be "yyyy-MM-dd'T'HH:mm:ssX" (i.e., just one 'X').
May 16, 2012 at 9:01 comment added PNS Same here about Java 6, but thanks for noting this.
May 16, 2012 at 8:57 comment added Alvin This is very nice to know. I'm still stuck with java 1.6- :(
May 16, 2012 at 8:46 history answered assylias CC BY-SA 3.0