Skip to main content

dateTimeUTCToLocal()

Last updated 18/07/2023

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


info

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


Available
Client and Server


Function Signature
dateTimeUTCToLocal(UTCDateTime: string) : string;

Return Value

A string representing the current local date and time, formatted as yyyy-mm-dd hh:mm:ss.

Example Output


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