The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: problem with java.sql.timestamp
Replies: 1   Last Post: Feb 15, 2013 1:12 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Steven Lord

Posts: 18,038
Registered: 12/7/04
Re: problem with java.sql.timestamp
Posted: Feb 15, 2013 1:12 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"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

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.