Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: problem with java.sql.timestamp
Posted:
Feb 15, 2013 1:12 PM
|
|
"Davide Zoccatelli" <davidezocca@yahoo.it> wrote in message news:kfls1d$7o6$1@newscl01ah.mathworks.com... > 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 slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com
|
|
|
|