|
| LocalTimeHMS () |
| Default constructor. Sets time to 00:00:00.
|
|
virtual | ~LocalTimeHMS () |
| Destructor.
|
|
| LocalTimeHMS (const char *str) |
| Constructs the object from a time string. More...
|
|
| LocalTimeHMS (const LocalTimeValue &value) |
| Construct this HMS from a LocalTimeValue (which contains YMD and HMS) More...
|
|
void | clear () |
| Sets the hour, minute, and second to 0.
|
|
void | parse (const char *str) |
| Parse a "H:MM:SS" string. More...
|
|
String | toString () const |
| Turns the parsed data into a normalized string of the form: "HH:MM:SS" (24-hour clock, with leading zeroes)
|
|
int | toSeconds () const |
| Convert hour minute second into a number of seconds (simple multiplication and addition)
|
|
void | fromTimeInfo (const struct tm *pTimeInfo) |
| Sets the hour, minute, and second fields from a struct tm.
|
|
void | fromLocalTimeValue (const LocalTimeValue &value) |
| Sets the HMS from a LocalTimeValue. More...
|
|
void | toTimeInfo (struct tm *pTimeInfo) const |
| Fill in the tm_hour, tm_min, and tm_sec fields of a struct tm from the values in this object. More...
|
|
void | adjustTimeInfo (struct tm *pTimeInfo) const |
| Adjust the values in a struct tm from the values in this object. More...
|
|
void | fromJson (JSONValue jsonObj) |
| Parses a JSON value of type string in HH:MM:SS format. More...
|
|
LocalTimeHMS & | withHour (int hour) |
| Sets this object to be the specified hour, with minute and second set to 0. More...
|
|
LocalTimeHMS & | withHourMinute (int hour, int minute) |
| Sets this object to be the specified hour and minute, with second set to 0. More...
|
|
int | compareTo (const LocalTimeHMS &other) const |
| Compare two LocalTimeHMS objects. More...
|
|
bool | operator== (const LocalTimeHMS &other) const |
| Returns true if this item is equal to other. Compares hour, minute, and second. More...
|
|
bool | operator!= (const LocalTimeHMS &other) const |
| Returns true if this item is not equal to other. More...
|
|
bool | operator< (const LocalTimeHMS &other) const |
| Returns true if this item is < other. More...
|
|
bool | operator> (const LocalTimeHMS &other) const |
| Returns true if this item is > other. More...
|
|
bool | operator<= (const LocalTimeHMS &other) const |
| Returns true if this item <= other. More...
|
|
bool | operator>= (const LocalTimeHMS &other) const |
| Returns true if this item is >= other. More...
|
|
Container for holding an hour minute second time value.
LocalTimeHMS::LocalTimeHMS |
( |
const char * |
str | ) |
|
Constructs the object from a time string.
- Parameters
-
The time string is normally of the form HH:MM:SS, such as "04:00:00" for 4:00 AM. The hour is in 24-hour format. Other formats are supported as well, including omitting the seconds (04:00), or including only the hour "04", or omitting the leadings zeros (4:0:0).
Additionally, the hour could be negative, used in UTC DST offsets. The minute and second are always positive (0-59). The hour could also be > 24 when used as a timezone offset.