Re: ResultSet getTimestamp
Posted by: Mark Matthews
Date: June 29, 2005 03:53PM

Martin Dubuc wrote:
> I have a table that contains a datetime column
> named StartTime.
>
> In my Java source, I perform the following
> operation:
>
> startTime = rs.getTimestamp("StartTime");
>
> What I have noticed is that getTimestamp performs
> some sort of timezone conversion. For instance, if
> the value of StartTime is "2005-07-04 01:00:00",
> when I print the result of getTimestamp, I see
> "2005-07-04 05:00:00". I would like to get the raw
> value from the database. How is it possible?
>
> Martin


Martin,

Do you have "useTimezone=true" in your JDBC URL? Timezone conversion won't happen if you don't have this configuration value set.

How do you print out the timezone value (some of the date formatting routines in Java will do timezone conversion).

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject
Written By
Posted
June 29, 2005 12:14PM
Re: ResultSet getTimestamp
June 29, 2005 03:53PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.