On May 2, 2007, at 2:29 PM, Stephen Colebourne wrote:
> Tom Duffey wrote:
>> Suppose I create a new DateTimeZone like:
>>
>> DateTimeZone zone = DateTimeZone.forID("US/Eastern");
>>
>> Now, calling zone.getID() returns "America/New_York" which is
>> logically the same time zone but not equal to the ID that I used to
>> build the object. Is there any way to get the original ID back?
>
> No, the conversion is automatic - its just an alias to the real
> underlying zones.
>
> Do you believe it should?
Maybe :) I'm mapping Joda DateTimeZone objects to and from a
database in our application which uses the more familiar "US/
Somewhere" style time zones in the UI. When something gets saved
with a zone like "US/Central" it is awkward for it to later come back
as "America/Chicago," which in my case is not even in the default
list of available zones.
I am tempted to say that yes, forID() and getID() should always
return the same strings. However, it would be good enough for my
needs (And potentially all object relational mapping related needs
for DateTimeZone objects) if there was some way to get the original
ID back.
Tom
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest