-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Pid,
On 10/8/2010 4:44 AM, Pid wrote: > On 08/10/2010 01:19, Jane Muse wrote: >> If I changed the system time zone not to change with daylight savings >> time, then it would be off by an hour. I don't think our customers would >> like that. Or am I misunderstanding your comment? > > The system timezone is almost irrelevant, you could use UTC or any other > stable timezone setting. +1 > The primitive long value of time inside a Date is the same regardless of > timezone. It sounds like you're relying on the system time for date > display, rather than formatting it as needed when you need to output it. Yeah, all Date objects ought to be merged with the user's TimeZone to display the proper locale date/time. Unfortunately, a java.util.Date object does /not/ carry TimeZone information with it, but is does depend upon the TimeZone in which it was created. For example, if your system time zone is "America/New_York" (mine), then all your date objects created during DST are essentially set to (-4 * 60 * 1000) for the timezone offset and (-1 * 60 * 1000) for the DST offset. If you want to convert that into a different time zone, you have to compute the difference between the two time zones. This is one of the reasons it's so advantageous to use UTC for storing dates as well as your system time zone, since the calculations are much simpler because one of the zone/DST offsets is always zero. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyvKxwACgkQ9CaO5/Lv0PDzdQCeI2MjoUV0achEE4mD4cgNbLmH BFUAoIFJKVuSBkA0jWRp5Zl9e9wV8uzl =Mx7U -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org