[ 
https://issues.apache.org/jira/browse/OPENJPA-1480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804025#action_12804025
 ] 

Craig Russell commented on OPENJPA-1480:
----------------------------------------

As I understand it, the time zone is strictly a memory artifact in Java and 
unless the database has a specific type "timestamp with time zone" then the 
time zone information is lost when you store the value in the database.

As far as I can find with a quick search, DB and MySQL don't offer a timestamp 
with time zone, but Oracle, SQLServer, and PostgreSQL do. 

> time zone info lost when using timestamp field
> ----------------------------------------------
>
>                 Key: OPENJPA-1480
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1480
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.2.3, 2.0.0-M3
>         Environment: at least DB2, Derby, Sybase
>            Reporter: B.J. Reed
>            Priority: Minor
>             Fix For: 1.2.3, 2.0.0-M3
>
>         Attachments: TestTimeZone.java, TZDataModel.java
>
>
> Looks like OpenJPA always gets the time stamp out at the time zone of the 
> machine, not the time zone that was used originally.
> The test case is putting in 2 TimeStamps
>     TTimestamp = 4-3-2004 21:0:0.0 (America/New_York)
>     TTimestampUTC = 4-4-2004 2:0:0.0 (UTC)
> When OpenJPA gets those 2 timesamps back out of the database, they are 
>     TTimestamp = 4-3-2004 21:0:0.0 (America/New_York)
>     TTimestampUTC = 4-3-2004 21:0:0.0 (America/New_York)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to