Menu

#450 Time('O') jumps 2hrs for Daylight Savings Time

v3.9.4
closed-fixed
None
5
2021-11-06
2015-04-01
SimonT
No

Hi - using 3.9.0 on W7 and W8.1 Europe time zone: A call to Time('O') went from +1 hours pre-DST to +3 hours post-DST (should be +2). The documentation mentions that it can be unreliable for some OS's, so not sure whether this is a bug or a Windows issue?

Thanks,
Simon T.

Discussion

  • Mark Hessling

    Mark Hessling - 2015-04-02

    If the only change in the environment is the date on which the test was run; ie Regina version the same, Windows OS the same, then it will be a Windows issue. Time('O') is determined by subtracting GMT from local time, and if DST is in effect, adds an hour. All time information is obtained from the operating system.

     
  • Mark Hessling

    Mark Hessling - 2015-04-02
    • status: open --> closed-invalid
    • assigned_to: Mark Hessling
     
  • Arthur T.

    Arthur T. - 2021-04-23

    I don't think this is invalid. If the operating system returns the DST-corrected local time and GMT, then your 1-hour correction forces an incorrect value in Regina. This is happening tome, too. All levels of Regina from through 3.9.3 on Windows 2000 & Windows10.

     
  • Stefan Haubenthal

    Indeed, remove this code

    if ( tmptr->tm_isdst )
       timediff += 3600;
    

    https://stackoverflow.com/questions/46258930/

     
  • Mark Hessling

    Mark Hessling - 2021-11-02
    • status: closed-invalid --> closed-fixed
    • Group: --> v3.9.4
     
  • Mark Hessling

    Mark Hessling - 2021-11-02

    Applied as per Stefan's suggestion

     
  • Paul Kislanko

    Paul Kislanko - 2021-11-06

    TIME('O') works, but on the last day of DST it appears that TIME('T') has the same bug:

    parse version v; say v; say time() time(,time('t'),'t')
    REXX-Regina_3.9.4(MT) 5.00 25 Oct 2021
    12:41:47 13:41:47
    
     

Log in to post a comment.