Getting Data In

How do you display multiple timezones corrected for daylight savings from a correct epoch time?

landen99
Motivator

How do you display multiple timezones corrected for daylight savings from a correct epoch time?

Tags (2)
0 Karma

landen99
Motivator

Create a macro to calculate the new time using UTC offsets. Create another macro to calculate the correct UTC offset based on the time of year for Daylight Savings:

 eval date_year=strftime(_time,"%Y"),date_mon=strftime(_time,"%m"),date_day=strftime(_time,"%e"),date_hour=strftime(_time,"%H"),date_min=strftime(_time,"%M"),date_sec=strftime(_time,"%S"),date_tz=strftime(_time,"%:::z"),date_tz_offset="+11",date_doy=strftime(_time,"%j"),date_hour_new=(date_hour-date_tz+date_tz_offset)%24,date_day_new=date_day+floor((date_hour-date_tz+date_tz_offset)/24),date_new=date_year."-".date_mon."-".date_day_new." ".date_hour_new.":".date_min.":".date_min." UTC".date_tz_offset,date=date_year."-".date_mon."-".date_day." ".date_hour.":".date_min.":".date_min." UTC".date_tz
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...