On May 7, 2007, at 12:13 AM, Stephen Colebourne wrote:

> Tom Duffey wrote:
>> On May 2, 2007, at 2:29 PM, Stephen Colebourne wrote:
>>> 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.
>
> I don't think we can change the standard Joda-Time behaviour on  
> this due
> to backwards compatibility, but it is something JSR-310 can consider.

After some more thought I don't think it's necessary to do anything  
as long as the statement:

DateTimeZone.forID("US/Eastern").equals(DateTimeZone.forID("America/ 
New_York")

evaluates true.  I'm guessing it does but have not tried it.  This  
solves my problem as long as I am careful to always compare  
DateTimeZone objects and not the strings that are actually persisted  
to the database.

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

Reply via email to