Tue Jun 28, 2022 6:15 pm
Login Register Lost Password? Contact Us

Please Note: The HPCC Systems forums are moving to Stack Overflow. We invite you to post your questions on Stack Overflow utilizing the tag hpcc-ecl (https://stackoverflow.com/search?tab=newest&q=hpcc-ecl). This legacy forum will be active and monitored during our transition to Stack Overflow but will become read only beginning September 1, 2022.

GMT to EST conversion in Version 7.2.28

Comments and questions related to the Enterprise Control Language

Wed Aug 21, 2019 12:43 pm Change Time Zone


What is the best way to convert time from GMT to EST in ECL version

There is a built-in function, which converts the given input time(in Time_t format) to the required TimeZone as given below

Code: Select all

//output : 105026

But how can we get the actual converted time wrt Daylight Savings as we are not giving any specific date as input to the function?
Posts: 1
Joined: Wed Aug 21, 2019 12:27 pm

Wed Aug 21, 2019 7:29 pm Change Time Zone

Daylight savings is a very complicated issue, as its observance varies by both geography and local laws. Geography isn't part of the Std.Date.TimeZone module, so there is not a way of automatically determining if DST should be included or not.

There is a single function that can tell you if DST may be if effect: Std.Date.IsLocalDaylightSavingsInEffect(). However, its return value is only for the current date/time and is determined by the time zone set in the HPCC Systems cluster's operating system; it also does not take into account geography or local laws, nor does it allow you to determine DST for a random date/time.

If you can make a determination regarding DST prior to calling Std.Date.TimeZone.AdjustTimeTZ(), you can adjust your arguments to switch between 'EST' or 'EDT' for the toTimeZoneAbbrev parameter. Note that in some cases you need to supply a toLocation argument as well to differentiate between time zones with the same abbreviation (e.g. 'CST').

Hope this helps.

Community Advisory Board Member
Community Advisory Board Member
Posts: 571
Joined: Tue Oct 18, 2011 4:45 pm

Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest