Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-3864

ToDate(userstring, format, timezone) computes DateTime with strange handling of Daylight Saving Time with location based timezones

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.12.0, 0.11.1
    • 0.18.0
    • None
    • None
    • Reviewed

    Description

      When using ToDate with a location based timezone (e.g. "Europe/Berlin") the handling of the timezone offset is based on whether the timezone is currently in daylight saving and not based on whether the timestamp is in daylight saving time or not.

      Example:

      B = FOREACH A GENERATE ToDate('2014-02-02 18:00:00.000Z', 'yyyy-MM-dd HH:mm:ss.SSSZ', 'Europe/Berlin') AS Timestamp;
      

      This yields

      2014-02-02 20:00:00.000+02

      when called during daylight saving in Europe/Berlin although I would expect

      2014-02-02 19:00:00.000+01

      During standard time In Europe/Berlin, the above call yields

      2014-02-02 19:00:00.000+01

      In Europe/Berlin DST started on March 30th, 2014.

      This seems pretty strange to me. If it is on purpose it should at least be noted in the documentation.

      Attachments

        1. PIG-3864-1.patch
          1 kB
          Daniel Dai

        Activity

          People

            daijy Daniel Dai
            fredericschmaljohann Frederic Schmaljohann
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: