static void Job10(Args _args) {
// 1) Save UTC date time to string
str strValue =
DateTimeUtil::toStr
(DateTimeUtil::utcNow()); utcdatetime utcValue; boolean isUTCDateTime = false; ; info(strFmt('Value (as saved string) = %1', strValue));
// 2) convert 'Saved' String to UTC date time
utcValue =
DateTimeUtil::parse
(strValue); if (utcValue != utcDateTimeNull()) isUTCDateTime = true;
// 3) convert UTC date time to string with apply time zone offset
if (isUTCDateTime) { strValue =
DateTimeUtil::toStr
(DateTimeUtil::applyTimeZoneOffset(utcValue, DateTimeUtil::getUserPreferredTimeZone())); } info(strFmt('Value (after convert) = %1', strValue)); info('done'); }
The result is here.
Until the next post!