A class which obeys periodic time-of-day boundaries, and can manage times being within a daily time frame. More...
#include <RTime.h>
Public Member Functions | |
TimeOfDay () | |
Default constructor, initializes to local time. | |
TimeOfDay (struct tm tmval) | |
Initializes to tmval. | |
TimeOfDay (u32 hr, u32 min=0, u32 sec=0) | |
Initializes to the given hr, min, sec from midnight. | |
TimeOfDay & | operator= (struct tm tmval) |
Initializes to tmval. | |
TimeOfDay & | operator-= (const TimeOfDay &other) |
Subtracts another TimeOfDay amount, obeying periodic boundaries. | |
TimeOfDay | operator- (const TimeOfDay &other) const |
Subtracts two TimeOfDay amounts, obeying periodic boundaries. | |
TimeOfDay & | operator+= (const TimeOfDay &other) |
Adds another TimeOfDay amount, obeying periodic boundaries. | |
TimeOfDay | operator+ (const TimeOfDay &other) const |
Adds two TimeOfDay amounts, obeying periodic boundaries. | |
bool | operator< (const TimeOfDay &other) const |
True if this TimeOfDay is < the other. | |
bool | operator<= (const TimeOfDay &other) const |
True if this TimeOfDay is <= the other. | |
bool | operator> (const TimeOfDay &other) const |
True if this TimeOfDay is > the other. | |
bool | operator>= (const TimeOfDay &other) const |
True if this TimeOfDay is >= the other. | |
bool | operator== (const TimeOfDay &other) const |
True if this TimeOfDay is == the other. | |
bool | Between (const TimeOfDay &left, const TimeOfDay &right) const |
True if this TimeOfDay is later than left and earlier than right, obeying periodic boundaries. | |
u32 | Hr () const |
Returns the 0-23 hour value after midnight. | |
u32 | Min () const |
Returns the 0-59 minute value after midnight. | |
u32 | Sec () const |
Returns the 0-59 second value after midnight. | |
u32 | AsSeconds () const |
Returns the total seconds after midnight. | |
u32 | AsMinutes () const |
Returns the total minutes after midnight. | |
u32 | AsHours () const |
Returns the total hours after midnight. | |
RStr | ToString (bool AmPm=false) const |
Returns a formatted string representation. | |
void | FromSeconds (u32 newsec) |
Initializes from a number of seconds after midnight. | |
void | FromMinutes (u32 newmin) |
Initializes from a number of minutes after midnight. | |
A class which obeys periodic time-of-day boundaries, and can manage times being within a daily time frame.