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

Add TimeZone support to EL date functions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.2.0
    • Core Framework
    • None

    Description

      Currently the toDate() and format() functions under the hood use a SimpleDateFormat with the current system timezone. This leads to hard to locate data inconsistency errors when parsing and then generating date strings when the date strings are not in the same or current time zone.

      Even the example given in the documentation
      ${time:format("yyyy/MM/dd HH:mm:ss.SSS'Z'")}
      will give an incorrect output when the system timezone is not set to GMT.

      suggestion is to add a variant to toDate(String tz) and format(String tz) which accepts a timezone of Java nomenclature which can be set with "SimpleDateFormat.setTimeZone(TimeZone.getTimeZone(tz))"

      Attachments

        Issue Links

          Activity

            People

              pvillard Pierre Villard
              dtorok Dave Torok
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: