Hi Andrew,

On 15/04/2009, at 7:40 PM, Andrew Lindesay wrote:

I have my own home-rolled formatters for date/time, but I am (as you obviously are) interested in using SDF instead. I figured that if SDF did not do this "timezone fiddle" itself, I would subclass it to achieve the correct value and then invoke super to handle the format. Likewise, I would do this in reverse for parse. I essentially undertake this transformation in my formatters. Keep us posted on your experiments.

It turns out that (not too surprisingly) SimpleDateFormat _will_ adjust timezones on format, but I was using an NSTimeZone, and ignoring this warning:

WARNING: NSTimeZone is only intended to be used with NSTimestamp and NSTimestampFormatter. It produces incorrect results when used with Java's date-related classes.

If I feed SimpleDateFormat the analogous java.util.TimeZone object, it adjusts the time as expected. Nothing to see here.


--
Paul.

w  http://logicsquad.net/
h  http://paul.hoadley.name/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to