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
.conf21 Now Fully Virtual!
Register for FREE Today!

We've made .conf21 totally virtual and totally FREE! Our completely online experience will run from 10/19 through 10/20 with some additional events, too!