Oko/Docs

Command reference

oko person zone set

Declares the operator's time zone once in his Oko profile. Every time Oko puts before him is written in it with UTC at most in brackets: `oko rulings check` and `oko asks ask` refuse a text whose UTC time stands outside brackets, and oko's lines for people print times in it.

Invocation#

Command
oko person zone set --zone IANA --by WHO [--json]

Inputs and options#

  • --zone, an IANA name the system's time zone database holds (`America/Los_Angeles`); --by, who declares it. The declaration is kept in `operator-zone.json` in Oko's folder (`OKO_OPERATOR_ZONE` names another file).

Output and state effect#

  • Writes `{zone, setBy, setAt}` and prints it with `now`, the present moment as he reads it (`<date> <hh:mm> <zone abbreviation> (<UTC>)`).

Refusals and safe exits#

  • `"<zone>" is not a time zone the system's database holds (/usr/share/zoneinfo/<zone> is not a zone file); name one such as America/Los_Angeles` and `oko person zone set requires a non-empty --by naming who declares it` (exit 2); nothing is written.
  • `oko person zone takes set --zone <IANA name> --by <who> or show; got "<verb>"` (exit 2). Real test: `tests/no-model/zone.rs` (`cargo test --test no-model-zone`).

CLI reference#