Module ggstd::time

source ·
Expand description

Package time provides functionality for measuring and displaying time.

The calendrical calculations always assume a Gregorian calendar, with no leap seconds.

Structs

  • A Time represents an instant in time with nanosecond precision.

Enums

  • A Month specifies a month of the year (January = 1, …).
  • A Weekday specifies a day of the week (Sunday = 0, …).

Functions

  • date returns the Time corresponding to
  • now returns the current local time.
  • unix returns the local Time corresponding to the given Unix time, sec seconds and nsec nanoseconds since January 1, 1970 UTC. It is valid to pass nsec outside the range [0, 999999999]. Not all sec values have a corresponding time value. One such value is 1<<63-1 (the largest i64 value).