Hi,
This issue confirm my doubts about the way JodaLocalxxx are saved. I have a branch in my repo with some correction in the Joda time attribute handling, the conversion in the save and read functions are not symmetric in the actual code.
I also updated the JodaTime lib to latest with updated time zones.
As I did not tested with LocalDateTime and LocalTime, the pull request is not created yet. If you want to test this code, it is on GitHub.
The interesting part is is ValueConversion.java public static Date jodaLocalDateTime(LocalDateTime value) { Date javaDate = value.toDate(); return javaDate; }
The old code switched the time zone to UTC before saving and JDBC was assuming a value with the current timezone. On read, the value was took from jdbc as is.
Samuel
JDBC still relies on java.sql.Timestamp, etc, which uses the system's time zone when saving and loading data. Usually the easiest solution is to set the default time zone to UTC by adding a VM argument -Duser.timezone=UTC
Then when you need to display date times you can choose a different time zone for display purposes explicitly.
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|