Documentation home / Native Module API
Native Module API
Time and Date Formatting
Read the current Unix timestamp and format timestamps as local-time strings or UTC ISO-8601 strings.
Purpose
Read the current Unix timestamp and format timestamps as local-time strings or UTC ISO-8601 strings.
Exported API
| Export | Role |
|---|---|
now | now native function or exported value |
format | format native function or exported value |
utc | utc native function or exported value |
Usage example
import gs_time; define timestamp = gs_time.now(); print(timestamp); print(gs_time.format(timestamp)); print(gs_time.utc(timestamp));
format accepts a timestamp and optional strftime-style format string. UTC formatting returns an ISO-8601 UTC timestamp.
