clock
clock subcommand ?arg ...?
The time. clock seconds gives the seconds since 1970-01-01 UTC. The time and the zone data come from the host.
Subcommands
| Synopsis | What it does |
|---|---|
clock seconds |
The seconds since the epoch. |
clock milliseconds |
The milliseconds since the epoch. |
clock microseconds |
The microseconds since the epoch. |
| `clock clicks ?-milliseconds | -microseconds?` |
clock format SECONDS ?-format FMT? ?-gmt BOOL? ?-timezone ZONE? ?-locale L? |
The time as text. %Y-%m-%d %H:%M:%S and the other fields of strftime. |
clock scan TEXT ?-format FMT? ?-gmt BOOL? ?-timezone ZONE? ?-base SECONDS? |
The seconds of a time in text. |
clock add SECONDS ?COUNT UNIT ...? ?-gmt BOOL? ?-timezone ZONE? |
The seconds after adding days, months, and other units. |
Examples
clock format 0 -format %Y-%m-%d -gmt 1gives1970-01-01clock scan 1970-01-02 -format %Y-%m-%d -gmt 1gives86400
Facts
- Capability:
clock. A new interpreter does not have this command. See Limits and capabilities. - Compute cost: one compute unit for the call, and more for the commands that it runs.