Skip to main content

dateTime()

Last updated 18/07/2023

The dateTime() is a function on the five object which is used to return the current date and time in local time as a string.


info

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


Available
Client and Server


Function Signature
dateTime(): string;

Return Value

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

Example Output


Output
console.log(five.dateTime()); // output '2022-08-30 03:25:00'

Examples

dateTime()