[ 
https://issues.apache.org/jira/browse/DERBY-7091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17235064#comment-17235064
 ] 

Larry Melvin Lemons commented on DERBY-7091:
--------------------------------------------

And yet it doesn't say anything about it automatically adding an hour to the 
time during the hour of daylight savings time change in the Spring (and not do 
anything in the Fall).  Shouldn't the default behavior be insert what is given, 
not assuming that an hour should be added because daylight savings time started 
during that hour and since most of the world changes it should just assume that 
is the time that the person wants?

 

Most database implementations in the government I have seen use UTC times, not 
local times.  If a local time is required then it is converted from the UTC 
time in the database.  Sure it might be a little more work on the programmer's 
side, however it is 100% accurate regardless of where you are in the world and 
no guessing what should be there.

I am trying to import several years of weather data into a database and the 
timestamp that is being used is a UTC time.  What you are telling me is that it 
is impossible using the timestamp field, which would make it a lot easier to 
run queries than a text field.

So how do I represent these times in the timestamp?  Arizona and Hawaii 
actually has a 2:00AM in the Spring when the daylight savings time starts for 
the rest of the world?

> Times Inserted Incorrectly Around Daylight Savings Time Change in Spring
> ------------------------------------------------------------------------
>
>                 Key: DERBY-7091
>                 URL: https://issues.apache.org/jira/browse/DERBY-7091
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.14.2.0
>         Environment: Java 14.0.1
>            Reporter: Larry Melvin Lemons
>            Priority: Critical
>         Attachments: Test.java, Timezone_Data_Inconsistencies.odt
>
>
> When inserting date/times into the timestamp field around the daylight 
> savings time change in the Spring, the times are inconsistent.  I am in/use 
> the New York EST/EDT timezone, but the data I am inserting is Standard time 
> and not Daylight Savings Time
> All the times are correct up to 1:48AM, then when it inserts 2:00 AM the data 
> in the database is 3:00AM.  That could be alright if it kept switching the 
> time to Daylight Savings Time, however going from inserting 2:48AM and 
> getting 3:48AM in the database, when it inserts 3:00AM it shows 3:00AM in the 
> database, not the expected 4:00AM.  Then in the fall whatever is inserted in 
> the database is what shows in the database around the daylight savings time 
> switch to standard time.  See the attached Open Document Text file for 
> examples of what is actually inserted and what is showing in the database.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to