suns or gcj date parsing way - parseFromThatZone or parse2myZone

Niklas Fondberg niklas.fondberg@i3micro.com
Tue Oct 2 14:35:00 GMT 2001


Ok take a string date (e.g. http date header) and look at the following code:
TimeZone tz = TimeZone.getTimeZone("Europe/Stockholm");
Locale locale = new Locale("En", "Us", "Unix");
DateFromat pdfmt = new SimpleDateFormat("EEE, dd MMM yyyy hh:mm:ss 'GMT'", locale);
// GCJ way
pdfmt.setTimeZone(tz);
// suns jdk way
pdfmt.setTimeZone(TimeZone.getTimeZone("GMT"));
 
Date hdate = pdfmt.parse(hdatestr, new ParsePosition(0));
Sun JDK 1.3 - parsing from a given timezone (GMT) to my default.
GCJ 3.0.2 - parsing from a timezone(GMT in this case???) to my given one.
Seems like a fundamental difference in thinking to me.
Hope I'm wrong and somebody tells me that I have done a mistake. But my testing is now (4th posting to this list and 4 days of testing) complete.
The above is anyhow my conclusion.
Please give me your thoughts
----------------------------------------------
Niklas Fondberg I3 Micro Technology
niklas.fondberg@i3micro.org


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /