How to convert local date time to UTC

Hi there

I’m pulling a date time value from SQL Server which is brought into Snaplogic as an local date time object like so
{_snaptype_localdatetime:2019-11-13T06:04:41.424}
this happens to be New York eastern time zone

I want to now convert this to a UTC date time.
{_snaptype_datetime:2019-11-13T11:04:41.424 UTC}

Time has been adjusted by 5 hours, but during day light savings period would need to adjust by 4 hours.

I’m struggling how to do this in a Snaplogic expression. All the functions seem to require that the date be an UTC date object. I could do this with a toString and then Date.parse, but this will be an exact UTC variation of the local date time.
{_snaptype_datetime:2019-11-13T06:04:41.424 UTC}
Not the
{_snaptype_datetime:2019-11-13T11:04:41.424 UTC}
that I want to see.

I can’t just add 5 hours as it isn’t always 5 hours difference during daylight savings.

I feel like this should be simple and I’m sorry in advance if I’m missing something obvious.

Thanks!

Hi Williams,

Below function need to be placed in mapper and you can change what ever timezone you want in the below single quote values

Date.now().toLocaleDateTimeString(’{“timeZone”:"‘UTC’"}’)