Time Library
1.20.0¶
#include <std/time.pat>
Types¶
std::time::Time
¶
A type representing a time point in a specific timezone.
std::time::EpochTime
¶
A type representing a time point in seconds since epoch time.
Functions¶
std::time::epoch() -> EpochTime
¶
Returns the current system time in seconds since epoch.
Parameter |
Description |
---|---|
|
Seconds since epoch |
std::time::to_local(EpochTime epoch_time) -> Time
¶
Converts a given epoch time to the local timezone time.
Parameter |
Description |
---|---|
|
Epoch time |
|
Time converted to local time |
std::time::to_utc(EpochTime epoch_time) -> Time
¶
Converts a given epoch time to the UTC timezone time.
Parameter |
Description |
---|---|
|
Epoch time |
|
Time converted to UTC time |
std::time::now(TimeZone time_zone = TimeZone::Local) -> Time
¶
Returns the current time in a given timezone.
Parameter |
Description |
---|---|
|
Entry from the |
|
Current time in the given timezone |
std::time::format(Time time, str format_string = "%c") -> str
¶
Formats the given time to a specified format. System format by default.
Parameter |
Description |
---|---|
|
Time to format |
|
Format string using standard C format specifiers |
|
Formatted time string |