datetime()

Time since epoch.

An epoch or reference epoch is an instant in time chosen as the origin of a particular calendar era, 00:00:00 UTC on 1 January 1970.

Returns the current date and time as a timestamp in seconds, time span value between the epoch and now

Syntax

datetime()

Parameters

Parameter Type Description
None

Return Value

Examples

datetime();  // returns current timestamp, e.g., 1709483045.123
dt = datetime(); // returns 1740923491.09200001
year(dt);        // returns 2025
month(dt);       // returns 3
day(dt);         // returns 2
hour(dt);        // returns 14
minute(dt);      // returns 51
second(dt);      // returns 31
millisec(dt);    // returns 92

See also

date
datetime
year
month
day
hour
minute
second
millisec