BoosterSeat
0.1
A C++ library that includes common utilities that are used in other projects.
|
Enumerations | |
enum class | TimeZone { UTC , LOCAL } |
Functions | |
std::string | dateAndTimeString (const bst::clck::TimePoint &time_point) |
std::string | dateAndTimeString (TimeZone time_zone=TimeZone::LOCAL, char date_delimiter='-', char between_delimiter=' ', char time_delimiter=':', bst::clck::TimePoint time_point=bst::clck::now()) |
Get the date and time in the format: YYYY-MM-DD HH:MM:SS. More... | |
bst::clck::TimePoint | dateAndTimeToTimePoint (int year, int month, int day, int hour, int minute, int second) |
Convert a date and time to a bst::clck::TimePoint. More... | |
std::string | dateString (TimeZone time_zone=TimeZone::LOCAL, char delimiter='-') |
std::string | elapsedAsciiClock (const bst::clck::TimePoint &time_point) |
std::string | timeString (TimeZone time_zone=TimeZone::LOCAL, char delimiter=':', bst::clck::TimePoint time_point=bst::clck::now()) |
Get the time in format: HH:MM:SS (24 hour clock) for a given time zone. More... | |
|
strong |
std::string bst::time::elapsedAsciiClock | ( | const bst::clck::TimePoint & | time_point | ) |
References bst::clck::secondsElapsed().
Referenced by main().
std::string bst::time::timeString | ( | TimeZone | time_zone = TimeZone::LOCAL , |
char | delimiter = ':' , |
||
bst::clck::TimePoint | time_point = bst::clck::now() |
||
) |
Get the time in format: HH:MM:SS (24 hour clock) for a given time zone.
time_zone | - The time zone to get the time in |
delimiter | - The delimiter to use (default: ':') |
time | - The time to get the string for (default: current time) |
References getTm(), timeFormatString(), and bst::clck::toTimeT().
Referenced by main().
std::string bst::time::dateString | ( | TimeZone | time_zone = TimeZone::LOCAL , |
char | delimiter = '-' |
||
) |
References dateFormatString(), and getTm().
Referenced by main().
std::string bst::time::dateAndTimeString | ( | TimeZone | time_zone = TimeZone::LOCAL , |
char | date_delimiter = '-' , |
||
char | between_delimiter = ' ' , |
||
char | time_delimiter = ':' , |
||
bst::clck::TimePoint | time_point = bst::clck::now() |
||
) |
Get the date and time in the format: YYYY-MM-DD HH:MM:SS.
References dateFormatString(), getTm(), timeFormatString(), and bst::clck::toTimeT().
Referenced by dateAndTimeString(), and main().
|
inline |
bst::clck::TimePoint bst::time::dateAndTimeToTimePoint | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | minute, | ||
int | second | ||
) |
Convert a date and time to a bst::clck::TimePoint.
All parameters are clamped to their respective ranges.
year | - The year (e.g. 2023, must be greater than 1970) |
month | - The month (1 - 12) |
day | - The day (1 - 31) |
hour | - The hour (0 - 23) |
minute | - The minute (0 - 59) |
second | - The second (0 - 59) |
References bst::clck::fromTimeT(), and bst::TIME_INVALID_TIME.
Referenced by main().