epochtime()
| Function group | Execute on client | Platform(s) |
|---|---|---|
| Date and Time | YES | All |
Syntax
epochtime([millis=kFalse])
Description
Returns the number of seconds since 00:00 on 1 Jan 1970 UTC (Unix time), or milliseconds if millis is kTrue. The result is a 64-bit integer.
Unix time is the number of seconds since 00:00:00 UTC on 1 January 1970, the form in which many web services, tokens and file formats exchange a moment in time. Because it is counted in UTC, the result is the same whatever the time zone of the machine and does not jump when daylight saving time starts or ends.
Pass kTrue for millis to get milliseconds instead. The result is a 64-bit integer, so assign it to a 64-bit Integer variable: seconds since 1970 no longer fit in a 32-bit integer after January 2038, and milliseconds never have.
The difference between two readings in milliseconds measures an operation far more precisely than getticks(), whose ticks are 1/60th of a second. The value comes from the system clock, however, so a reading taken either side of the clock being set, by hand or by a time server, does not give the true time elapsed.
In a client-executed method the time is read from the client's clock.