Re: timestamp and daylight saving
Posted by: Bernt Johnsen
Date: February 27, 2013 06:02AM

Thi is unrelated to MySQL end Connector/J. java.sql.Timestamp is a subclass of java.util.Date. If a java.util.Date object set to the non-existing during the transition to daylight savings time, the result will be 1+ the given hour.

Run this sample program:

package daylight;

import java.util.Date;
import java.util.TimeZone;

public class Daylight {

public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("Europe/Oslo"));
Date d = new Date(2012-1900, 02, 25, 2, 30); // 2012-03-25 02:30
System.out.println(d.toString());
}
}

Options: ReplyQuote


Subject
Written By
Posted
Re: timestamp and daylight saving
February 27, 2013 06:02AM


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.