time
Library to handle time and date related operations.
Types
std::time::DOSDate
std::time::DOSDateA type to represent a DOS date.
bitfield DOSDate { ... } [[sealed]];std::time::DOSTime
std::time::DOSTimeA type to represent a DOS time.
bitfield DOSTime { ... } [[sealed]];std::time::EpochTime
std::time::EpochTimeA type to represent a time in seconds since the epoch.
using EpochTime = ;std::time::Time
std::time::TimeA structured representation of a time and date.
struct Time { ... } [[sealed]];std::time::TimeConverter
std::time::TimeConverterA helper type to convert between Time and u128.
std::time::TimeZone
std::time::TimeZoneA type to represent a time zone.
Functions
std::time::epoch
std::time::epochReturns the current time in seconds since the epoch.
return: The current time in seconds since the epoch.
std::time::to_local
std::time::to_localConverts a time in seconds since the epoch to a local time.
epoch_time: The time in seconds since the epoch.return: The local time.
std::time::to_utc
std::time::to_utcConverts a time in seconds since the epoch to a UTC time.
epoch_time: The time in seconds since the epoch.return: The UTC time.
std::time::now
std::time::nowQueries the current time in the specified time zone.
[time_zone]: The time zone to query. Defaults to local.return: The current time in the specified time zone.
std::time::to_dos_date
std::time::to_dos_dateConverts a value to a DOS date.
value: The value to convert.return: The DOS date.
std::time::to_dos_time
std::time::to_dos_timeConverts a value to a DOS time.
value: The value to convert.return: The DOS time.
std::time::filetime_to_unix
std::time::filetime_to_unixConverts a FILETIME to unix time.
value: The value to convert.return: Timestamp formatted as unix time.
std::time::format
std::time::formatFormats a time according to the specified format string.
time: The time to format.[format_string]: The format string to use. Defaults to "%c".return: The formatted time.
std::time::format_dos_date
std::time::format_dos_dateFormats a DOS date according to the specified format string.
date: The DOS date to format.[format_string]: The format string to use. Defaults to "{}/{}/{}".return: The formatted DOS date.
std::time::format_dos_time
std::time::format_dos_timeFormats a DOS time according to the specified format string.
time: The DOS time to format.[format_string]: The format string to use. Defaults to "{:02}:{:02}:{:02}".return: The formatted DOS time.
Last updated
Was this helpful?