timespec
- A record specifying a time value in seconds and microseconds.tm
tm for tm
at
- Returns the specified time in the local timezoneat_utc
- Returns the specified time in UTCempty_tm
get_time
- Returns the current time as a timespec
containing the seconds and microseconds since 1970-01-01T00:00:00Z.now
- Returns the current time in the local timezonenow_utc
- Returns the current time in UTCprecise_time_ns
- Returns the current value of a high-resolution performance counter in nanoseconds since an unspecified epoch.precise_time_s
- Returns the current value of a high-resolution performance counter in seconds since an unspecified epoch.strptime
- Parses the time from the string according to the format string.tzset
timespec
type timespec = {sec: i64, nsec: i32,}
A record specifying a time value in seconds and microseconds.
tm
type tm = {tm_sec: i32,
tm_min: i32,
tm_hour: i32,
tm_mday: i32,
tm_mon: i32,
tm_year: i32,
tm_wday: i32,
tm_yday: i32,
tm_isdst: i32,
tm_gmtoff: i32,
tm_zone: str,
tm_nsec: i32,}
tm for tm
to_timespec
fn to_timespec() -> timespec
Convert time to the seconds from January 1, 1970
to_local
fn to_local() -> tm
Convert time to the local timezone
to_utc
fn to_utc() -> tm
Convert time to the UTC
ctime
fn ctime() -> str
Return a string of the current time in the form "Thu Jan 1 00:00:00 1970".
strftime
fn strftime(format: str) -> str
Formats the time according to the format string.
rfc822
fn rfc822() -> str
Returns a time string formatted according to RFC 822.
local: "Thu, 22 Mar 2012 07:53:18 PST" utc: "Thu, 22 Mar 2012 14:53:18 UTC"
rfc822z
fn rfc822z() -> str
Returns a time string formatted according to RFC 822 with Zulu time.
local: "Thu, 22 Mar 2012 07:53:18 -0700" utc: "Thu, 22 Mar 2012 14:53:18 -0000"
rfc3339
fn rfc3339() -> str
Returns a time string formatted according to ISO 8601.
local: "2012-02-22T07:53:18-07:00" utc: "2012-02-22T14:53:18Z"
at
fn at(clock: timespec) -> tm
Returns the specified time in the local timezone
at_utc
fn at_utc(clock: timespec) -> tm
Returns the specified time in UTC
empty_tm
fn empty_tm() -> tm
get_time
fn get_time() -> timespec
Returns the current time as a timespec
containing the seconds and microseconds since 1970-01-01T00:00:00Z.
now
fn now() -> tm
Returns the current time in the local timezone
now_utc
fn now_utc() -> tm
Returns the current time in UTC
precise_time_ns
fn precise_time_ns() -> u64
Returns the current value of a high-resolution performance counter in nanoseconds since an unspecified epoch.
precise_time_s
fn precise_time_s() -> float
Returns the current value of a high-resolution performance counter in seconds since an unspecified epoch.
strptime
fn strptime(s: str, format: str) -> result<tm, str>
Parses the time from the string according to the format string.
tzset
fn tzset()