

| eval time_in_AEST = strftime(_time_AEST, "%F %T ". does not support day light savings time). Inspired by the excellent answers provided here, it is possible to convert to an arbitrary timezone provided that timezone always has a fixed UTC offset (i.e. Depends on the requirement it could be used.įinally - why Splunk doesn't provide native TZ Conversion function is a question. US/Eastern->Other regions has some errors around the clock change dates. Other Regions->US/Eastern result is acceptable MET US/Eastern conversion has many errors and can't be used in production

From US/Eastern to other regions From Region The correct result should be 10:03:00 US/Eastern instead of 11:03:00 US/Easternģ. Use the 02:03:00 Australia/Sydney as an example, per Time Converter and World Clock - Conversion at a Glance - Pick best time to schedule conference call. From other regions to US/Eastern, one year there's one hour incorrectĪsia/Seoul, Australia/Sydney,Europe/London,Europe/Paris,GB-Eire,GMT,Japan from I got the total count: 5209 results of 8761 tests were incorrect, compared with the Python converted one.Ģ. | eval from_t=strptime(strftime(t, "%c.%6N ". Most of the METUS/Eastern conversion is incorrect | makeresults I checked for every hour from to for a few TZs, to ensure all clock changes are coveredġ. | fields converted, from_tz, to_tz | table converted, from_tz, to_tz

| append When it approaches to the clock change hour(i.e. It assumes the gap is 01:10 US/Eastern and 2022-11:06 01:10 Australia/Sydney. The way to calculate the two time zone's time gap is incorrect: Try below, convert 01:10 US/Eastern and 02:10 US/Eastern to Australia/Sydney time, you get 15:10(Incorrect) and 18:10(Correct) Sydney time respectively. The list of timezone names appear to be the standard list from Java. But other timezone names (like Australia/Melbourne used in the example), which are sometimes DST and sometimes not, will change offset according to the input date. Note that if you put in explicit DST timezone names like 'AEDT' then it will ALWAYS be daylight savings, regardless of the date. Also the offset variable is unused, but is just there so you can experiment by changing dates and timezones to see that the offset does actually change depending on whether daylight savings is applicable for the date. It can be simplified for brevity, I've just broken it into different variables to make it easier to follow.

The list of timezone names appear to be the standard list from on the answer above, here is a version that DOES account for daylight savings timezones, as well as times with microseconds: | makeresults Improving on the answer above, here is a version that DOES account for daylight savings timezones, as well as times with microseconds: | makeresultsįrom_t=strptime(strftime(t, "%c.%6N ".
