sys_current_datetime()

Get the current date and time, in the account owner's timezone, as YYYY-MM-DD HH:MM:SS.

Syntax

sys_current_datetime()

Parameters

None.

Returns

A datetime string, YYYY-MM-DD HH:MM:SS.

Example

record_comment("orders", $record["_meta"]["id"],
    "Processed at " . sys_current_datetime());

Example output

"2026-06-12 14:35:09"

Notes

  • Uses the account owner's timezone. Record datetime fields are stored in UTC — convert with date_to_utc() before writing a datetime field, and date_from_utc() when displaying one.

See also: sys_current_date(), date_from_utc()