Hi, I didn't run it myself, but ValueTimestamp.getDate() returns a java.sql.Date (with the time set to 0) not a java.util.Date. What you might want to do is use getTimestamp() instead.
But why do you use internal classes of the database engine? Regards, Thomas On Thu, Nov 8, 2012 at 2:23 PM, Steve <[email protected]> wrote: > Hi! > My database contains a table which contains a java.sql.TIMESTAMP column. I > found in the h2 databse source the ValueTimestamp.parse(String) function > and so I tried to set the value of that column bei an ISO 8601 String > "2012-11-08T12:40:11.156Z". > I was able to insert the row without any exception but in my opinion is > the parsed value not correct. > > > org.h2.value.ValueTimestamp.parse("2012-11-08T12:40:11.156Z").getDate() > --> internal java.util.Date.fasttime: 1352329200000 > > > DatatypeFactory.newInstance().newXMLGregorianCalendar("2012-11-08T12:40:11.156Z").toGregorianCalendar().getTime() > --> internal java.util.Date.fasttime: 1352378411156 > > Am I doing something wrong? Or will this bug fixed by the planned change > "Support > date/time/timestamp as documented in http://en.wikipedia.org/wiki/ISO860" > > Best Regards, > Steve > > > > -- > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/h2-database/-/Mo89yOCxVsAJ. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
