Skip to main content

dateTimeLocalToUTC()

Last updated 18/07/2023

The dateTimeLocalToUTC() is a function on the five object which is used to convert the current local date and time to a UTC timestamp.


info

When using the dateTimeLocalToUTC() on a table event the data type for the field must be TimeStamp.


Available
Client and Server


Function Signature
dateTimeLocalToUTC(localDateTime: string) : string;

Return Value

A string representing the current timestamp in UTC time zone, formatted as RFC 3339.

Example Output


Output, local timezone is AEST UTC/GMT +10 hours
console.log(five.dateTimeLocalToUTC('2022-08-30 20:25:00')); // output '2022-08-30 10:25:00.000000'