Is there a tool that converts DateTimeNow to GMT time zone while taking into consideration DST changes?
Solved! Go to Solution.
Hey @Apcvirgo1, as GMT = UTC, you can wrap the DateTimeNow() function in the DateTimeToUTC() function which will convert your local system time to UTC. That said, UTC doesn't observe DST and so In order to account for this, I think you'd need to introduce a lookup table of dates as well as the time adjustments (+/- X hours), then use a Formula tool with an expression that adds that difference, using DateTimeAdd().
Hi @Apcvirgo1
DateTimeNow() uses the system date and time, you can use DateTimeToUTC(DateTimeNow()) to convert the system date to Coördinated Universal Time
The UK is on UTC between the last Sunday of October and the last Sunday of March. As these things are variable, there isn't an actual tool that can do this (other than maybe the python/R or run command tools).
I've built this workflow which will output the current time in UK time - most of which is dynamically producing the change times for the current year
Hope that helps,
Ollie
Thank you @OllieClarke for this. For some reason Formula14 is erroring due to the "between" - receiving Unknown function. Maybe it's the version we use here.
Hi @Apcvirgo1
Yeah, the between() function was released in version 2023.1 I commented a version of the formula which doesn't use it, so delete the active formula and remove the "//" to use that version (also here)
IF DateTimeToUTC(datetimeNow())>=[Forward] AND DateTimeToUTC(datetimeNow())<[Back]
THEN DateTimeAdd(DateTimeToUTC(dateTimeNow()),1,'hour')
ELSE DateTimeToUTC(dateTimeNow())
ENDIF
@OllieClarke thanks again - this works well