31 char delimiter =
'-');
39 char date_delimiter =
'-',
char between_delimiter =
' ',
40 char time_delimiter =
':',
60 int hour,
int minute,
int second);
85 Time(
bool set_to_now =
false);
116 bool fromString(
const std::string &time_string);
134 unsigned int getDay()
const;
The generic time class for BoosterSeat. Uses UTC time.
Definition: time.hpp:79
bool operator!=(const Time &rhs) const
Definition: time.cpp:221
Time(bool set_to_now=false)
Construct a new Time object. Defaults to the epoch.
Definition: time.cpp:141
bool operator<(const Time &rhs) const
Definition: time.cpp:201
unsigned int getMinute() const
Get the Minute.
Definition: time.cpp:191
bool operator<=(const Time &rhs) const
Definition: time.cpp:209
time_t time_
Definition: time.hpp:167
void setToNow()
Set the time to the current time.
Definition: time.cpp:147
unsigned int getMonth() const
Get the Month (1 - 12)
Definition: time.cpp:176
bool operator>(const Time &rhs) const
Definition: time.cpp:205
time_t getTimeType() const
Definition: time.hpp:154
bool fromString(const std::string &time_string)
Definition: time.cpp:157
bool operator==(const Time &rhs) const
Definition: time.cpp:217
unsigned int getYear() const
Get the Year.
Definition: time.cpp:171
unsigned int getSecond() const
Get the Second.
Definition: time.cpp:196
unsigned int getHour() const
Get the Hour.
Definition: time.cpp:186
unsigned int getDay() const
Get the Day.
Definition: time.cpp:181
int64_t secondsFromNow() const
Returns the number of seconds from the current time to the stored time.
Definition: time.cpp:225
std::string toString() const
Get the time/date as a string in the format: YYYY-MM-DD HH:MM:SS.
Definition: time.cpp:151
bool operator>=(const Time &rhs) const
Definition: time.cpp:213
std::chrono::time_point< Clock > TimePoint
Definition: clock.hpp:16
TimePoint now()
Definition: clock.hpp:19
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.
Definition: time.cpp:56
std::string elapsedAsciiClock(const bst::clck::TimePoint &time_point)
Definition: time.cpp:15
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.
Definition: time.cpp:39
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.
Definition: time.cpp:73
std::string dateString(TimeZone time_zone=TimeZone::LOCAL, char delimiter='-')
Definition: time.cpp:48
TimeZone
Definition: time.hpp:14
Definition: filesystem.cpp:34
uint32_t getUnixTime()
Get the current Unix time.
Definition: time.cpp:134