Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-18148

STD.Date SecondsFromParts daylight savings time possible issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.0
    • Component/s: ECL Standard Library
    • Labels:
      None

      Description

      I’m attempting to use STD.Date.SecondsFromParts and STD.Date.CreateDateTimeFromSeconds to convert a date (YYYYMMDDHHMMSS) to epoch seconds, manipulate it (in particular, subtract a second), and then convert the result back to YYYYMMDDHHMMSS.  However, I’m seeing that the second step appears to be adding an hour to the result.

      When I run the following ECL with 20170411000000 as the input, I get date pieces that would form 20170411010000 as the result …

       

      secs := STD.Date.SecondsFromParts(2017,4,11,0,0,0);
      DATASET([STD.Date.CreateDateTimeFromSeconds(secs)]);
      

       

      I implemented some code using this and verified that it was working correctly last fall/winter (when it wasn’t yet daylight savings time in the US), and so I wonder if the issue is related to daylight savings time.

      In addition, STD.Date.SecondsFromParts has an is_local_time parameter that defaults to FALSE, but STD.Date.CreateDateTimeFromSeconds has no time zone option.  If I set is_local_time to TRUE,  I get a result that is 4 hours ahead of what I get when is_local_time = FALSE, which I also wouldn’t expect for a server in Alpharetta, GA (seems like that flag is backwards?).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dcamper Dan S. Camper
                Reporter:
                hsherrington Heather Sherrington
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: