Crate utc_offset
Source - Errors
- Soft errors that may occur in the process of initializing the global utc offset.
- Error
- An enumeration of all possible error that may occur here.
- get_global_offset
- Returns the global offset value if it is initialized, otherwise it
returns an error. Unlike the
try_set_
functions, this waits for a read lock. - get_local_timestamp_from_offset_rfc3339
- Gets a timestamp string using the specified offset
- get_local_timestamp_rfc3339
- Gets a timestamp string using in either the local offset or +00:00
- get_utc_offset
- Do whatever it takes to get a utc offset and cache it.
Worst case scenario we just assume UTC time.
- try_set_global_offset
- Attempts to set the global offset, returning an error if the
write lock cannot be obtained.
- try_set_global_offset_from_pair
- Sets a static UTC offset to use with future calls to
get_local_timestamp_rfc3339
- try_set_global_offset_from_str
- Sets a static UTC offset, from an input string, to use with future calls to
get_local_timestamp_rfc3339
. The format should be [+/-]HHMM.
- Result
- Wrapper with error defaulted to our Error.