S
Scott Harper
I have the following sequence of code:
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-DD'T'HH:mm:ss'Z'");
ParsePosition pos = new ParsePosition(0);
Date date = df.parse("2006-04-03T12:00:00Z", pos);
System.out.println(date);
It yields the following output:
Tue Jan 03 12:00:00 CST 2006
No matter what I provide to the parse method for the date/time string, the
month *always* comes back as January. The 'T' and 'Z' are literal
characters (even though I realize that Z is a valid format field for time
zone)... I've tried taking those literals out of my pattern i.e.
"yyyy-MM-DD HH:mm:ss"
but I still get the same results. Can anyone see what I might be doing wrong?
This is with JDK 5...
thanks
scott
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-DD'T'HH:mm:ss'Z'");
ParsePosition pos = new ParsePosition(0);
Date date = df.parse("2006-04-03T12:00:00Z", pos);
System.out.println(date);
It yields the following output:
Tue Jan 03 12:00:00 CST 2006
No matter what I provide to the parse method for the date/time string, the
month *always* comes back as January. The 'T' and 'Z' are literal
characters (even though I realize that Z is a valid format field for time
zone)... I've tried taking those literals out of my pattern i.e.
"yyyy-MM-DD HH:mm:ss"
but I still get the same results. Can anyone see what I might be doing wrong?
This is with JDK 5...
thanks
scott