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

Donald Woods commented on OPENJPA-1480:
---------------------------------------

Not sure if this helps, but the latest DB2 9.5 Fixpack 5 from Dec. includes 
some new date/time functions -

http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.wn.doc/doc/c0055554.html

FP5: XQuery functions make it easier to retrieve date and time values for local 
time zones

Four new XQuery functions return current date and time values using the local 
time zone of the DB2® database system.

The functions are db2-fn:current-local-time(), db2-fn:current-local-date(), 
db2-fn:current-local-dateTime(), and db2-fn:local-timezone(). They differ from 
fn:current-time(), fn:current-date(), and fn:current-dateTime(), which return 
the date and time values in the UTC implicit timezone and include a time zone 
component in the returned value.

For example, if the fn:current-time() function was invoked on November 20, 2009 
at 13:00 on a DB2 database system in Toronto (timezone -PT5H), the returned 
value might be 18:00:50.282691Z, whereas the db2-fn:current-local-time() 
function would return the value 13:00:50.282691.


> 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, 1.3.0, 2.0.0-M3, 2.0.0-beta
>         Environment: at least DB2, Derby, Sybase
>            Reporter: B.J. Reed
>            Priority: Minor
>             Fix For: 1.2.3, 1.3.0, 2.0.0
>
>         Attachments: 1280-1.2.x.patch, OPENJPA-1480-TestCalendarField.patch, 
> 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