Question
· Jun 2, 2022

Converting from UTC

Hi Guy,

is there like a utility or a function that convert from UTC to Locale time?

Thanks

Product version: Ensemble 2014.1
Discussion (4)3
Log in or sign up to continue

You can convert with $SYSTEM.Util.UTCtoLocalWithZTIMEZONE().

https://cedocs.intersystems.com/ens20141/csp/documatic/%25CSP.Documatic.cls?&LIBRARY=%25SYS&CLASSNAME=%25SYSTEM.Util

USER>write $SYSTEM.Util.UTCtoLocalWithZTIMEZONE($ZTIMESTAMP)
66263,48361.382728
USER>write $ZTIMESTAMP
66263,15968.3579578
USER>
 
USER>write $ZDATETIME($SYSTEM.Util.UTCtoLocalWithZTIMEZONE($ZTIMESTAMP),3)
2022-06-03 13:26:26
USER>write $ZDATETIME($ZTIMESTAMP,3)
2022-06-03 04:26:34
USER>