Date: Feb 15, 2013 1:12 PM
Author: Steven Lord
Subject: Re: problem with java.sql.timestamp

"Davide Zoccatelli" <> wrote in message
> I'm running a Matlab function ('fastinsert') to insert data into MySQL.
> The results are correct for the whole year except for 1 hour in March,
> during daylight saving. In fact it seems that I cannot insert data between
> 2:00am and 3:00am on that day.
> For example with:
> ts = 2006 3 26 2 30 0
> looking within the matlab function I found that the problem lies into:
> java.sql.Timestamp(ts(1)-1900,ts(2)-1,ts(3),ts(4),ts(5),secs,nanosecs)
> that gives as a result:
> 2006-03-26 03:30:00.0
> So using java.sql.Timestamp I have a +1h shift ONLY during the single hour
> of daylight saving in the end of March.
> so, looking at the results of the previous example:
> - the object generated by java.sql.timestamp has a timezoneOffset relative
> to my local time (GMT+1, with +1 DST in summer), which is correct
> - timezoneoffset is correct, but it really seems that the time wrote in
> the object is wrong after running that timestamp for that particular hour
> Any idea of what happened?

Are you able to reproduce this with a standalone Java program (taking MATLAB
completely out of the picture?) If you are able to reproduce this without
MATLAB, I recommend asking Oracle or perhaps posting in a more Java-centric
forum (Stack Overflow, for instance.)

Steve Lord
To contact Technical Support use the Contact Us link on