EL expressions may have incorrect DST.

  • 27 January 2022
  • 0 replies
  • 9 views

Userlevel 3

If you're using some of the time EL expressions which use time zones and seem to be having a problem with determining the correct time.  In some cases it may seem to be off by an hour.  Sometimes this can be caused by an environment problem on your machine.  Depending on the time zone selected for or set by the user, service user or the system default time zone, it may not be set up to correctly handle Daylight Savings Time. 

If the shell or default system environment in which your JVM starts has a timezone which does not support daylight savings time, for example, using `export TZ=EST" the time:dateTimeZoneOffset EL expression always returns a 5-hour offset regardless of what date is provided. 

On the other hand, if the shell timezone is set to `export TZ=America/New_York`, the time:dateTimeZoneOffset EL expression works correctly - 4-hour offsets for dates in August - 5 hour offsets for dates in February.

An easy way to test this is to use the JVM parameter `-Duser.timezone=America/New_York` (you can set this parameter to the SDC_JAVA_OPTS in the sdc-env.sh/sdcd-env.sh) files, or just add it to the command line if you're testing Data Collector in the shell.  This parameter forces the JVM to override the timezone information picked up from the shell.  

You can also test with something like `-Duser.timezone=EST` to force all dates to have a 5-hour offsets.


This topic has been closed for comments