date formatting

Tom Tromey
Tue Jul 10 21:57:00 GMT 2001

>>>>> "Nic" == Nic Ferrier <> writes:

Nic> I'm not entirely sure about the fix though because I have to
Nic> admit that I don't really understand the SimpleTimeZone.

You're not alone.  Some of the code here, or in Calendar, exists due
to extensive debugging.  I spent a few days running test cases through
this code and then finding bugs, sometimes very obscure, to get what I
thought were the correct results.

Nic> The thing I most don't understand is how DSTs come into it
Nic> all... the code that exists in SimpleDateFormat and
Nic> DateFormatSymbols makes it look like Java is supposed to parse
Nic> strings with DST timezones but how is it supposed to know the
Nic> time zone ids for DSTs?

I don't remember :-(.  I flushed all that info as quickly as I could.

The JCL books and online docs aren't really all that informative.
They do ok, but these classes are pretty big and not all the cases are
covered in the docs (as I recall).  My recommendation is to write test
code (preferably Mauve tests!), then run it through the JDK and gcj
and see what happens.  That is how I did my debugging...

Nic> Anyway, I have a fix that at least allows me to parse HTTP dates
Nic> and get the correct date so now Paperclips quite merrily sends
Nic> 304s.

Nic> Should I send it to the patches list?

Yes, definitely.


More information about the Java mailing list