On This Page

Home / Search/ Language Reference/ Functions/ Scalar Functions/ DateTime Functions/now

now ​

The now function returns the current UTC clock time as a datetime value (Unix time in seconds), optionally offset by a given timespan.

You can use now multiple times in a statement and the clock time being referenced will be the same for all instances.

To convert datetime (Unix time) into a string, or vice versa, use the strftime and strptime functions.

Syntax ​

now( [ Offset ] )

Arguments ​

  • Offset: A timespan, added to the current UTC clock time. Default: 0.

Returns ​

The current UTC clock time as a datetime.

Examples ​

This returns the current time, in Unix time:

print now()

This returns the current time two days earlier, in Unix time:

print now(-2d)