dateTimeLocalToUTC()
Last updated 5/02/2024
The dateTimeLocalToUTC()
is a function on the Five
object used to convert the current local date and time to a UTC timestamp.
info
When using the dateTimeLocalToUTC()
function 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('2024-02-14T13:59:00.000+10:00')); // output '2024-02-14 03:59:00'