Skip to main content

dateTimeUTCToLocal()

Last updated 5/02/2024

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


info

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


Available
Client and Server


Function Signature
dateTimeUTCToLocal(timestamp: 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('2024-02-14 03:59:00')); // output '2024-02-14T13:59:00.000+10:00'

Examples

dateTimeUTCToLocal()