Comment on page
time
Library to handle time and date related operations.
A type to represent a DOS date.
bitfield DOSDate { ... } [[sealed]];
A type to represent a DOS time.
bitfield DOSTime { ... } [[sealed]];
A type to represent a time in seconds since the epoch.
using EpochTime = u32;
A structured representation of a time and date.
struct Time { ... } [[sealed]];
A helper type to convert between Time and u128.
union TimeConverter { ... };
A type to represent a time zone.
enum TimeZone : u8 {
Local,
UTC
};
Returns the current time in seconds since the epoch.
return
: The current time in seconds since the epoch.
fn epoch();
Converts a time in seconds since the epoch to a local time.
epoch_time
: The time in seconds since the epoch.return
: The local time.
fn to_local(std::time::EpochTime epoch_time);
Converts a time in seconds since the epoch to a UTC time.
epoch_time
: The time in seconds since the epoch.return
: The UTC time.
fn to_utc(std::time::EpochTime epoch_time);
Queries the current time in the specified time zone.
time_zone
: The time zone to query.return
: The current time in the specified time zone.
fn now(std::time::TimeZone time_zone);
Converts a value to a DOS date.
value
: The value to convert.return
: The DOS date.
fn to_dos_date(u16 value);
Converts a value to a DOS time.
value
: The value to convert.return
: The DOS time.
fn to_dos_time(u16 value);
Converts a FILETIME to unix time.
value
: The value to convert.return
: Timestamp formatted as unix time.
fn filetime_to_unix(u64 value);
Formats a time according to the specified format string.
time
: The time to format.format_string
: The format string to use.return
: The formatted time.
fn format(std::time::Time time, str format_string);
Formats a DOS date according to the specified format string.
date
: The DOS date to format.format_string
: The format string to use.return
: The formatted DOS date.
fn format_dos_date(std::time::DOSDate date, str format_string);
Formats a DOS time according to the specified format string.
time
: The DOS time to format.format_string
: The format string to use.return
: The formatted DOS time.
fn format_dos_time(std::time::DOSTime time, str format_string);
Last modified 24d ago