Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-11367

Database DATE value displayed incorrectly in record output if timezone is GMT-X

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-M1, 1.21.0
    • None
    • None

    Description

      Suppose a database stores a date in a field e.g.  "2023-03-10".

      QueryDatabaseTableRecord returns the value of the date field as "2023-03-10" if local timezone is GMT+ , but it returns wrong date,  actual day -1 ("2023-03-09") if the local timezone is GMT-x.

      The reason is the date value taken from the DB was converted to UTC (1).

      Later on NiFi converts the date value to local time. (2)

      In step#1, the "2023-03-10" in converted to 10th March 2023 00:00 UTC.

      In step#2, when date is converted to local date, GMT-5 for example, the result will be 9th March 2023 19:00, so the day changes, it will be set to 9th March 2023 ("2023-03-09")

       

      Since NiFi uses local time there is no need to convert the database date values to UTC.

       

       

       

       

      Attachments

        Issue Links

          Activity

            People

              kzsihovszki Zsihovszki Krisztina
              kzsihovszki Zsihovszki Krisztina
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h