Time implementation representing a time of day (00:00:00,0 - 23:59:59,999999)
More...
|
int | _hour |
|
int | _minute |
|
int | _second |
|
int | _microsecond |
|
Time implementation representing a time of day (00:00:00,0 - 23:59:59,999999)
- Warning
- : This class does not enforce time consistency!
Definition at line 152 of file workspace/conan/dev_essential/1.3.4/dw/stable/package/aef85909f792a5a628750d25016a24323084963f/include/a_util/datetime/datetime.h.
◆ Time()
Time |
( |
int |
hour, |
|
|
int |
minute, |
|
|
int |
second, |
|
|
int |
microsecond = 0 |
|
) |
| |
Constructor for presetting the stored time.
- Parameters
-
[in] | hour | The hour. |
[in] | minute | The minute. |
[in] | second | The second. |
[in] | microsecond | The microsecond. |
◆ format()
std::string format |
( |
const std::string & |
format_str | ) |
const |
Creates a string representation of the stored time.
- Parameters
-
[in] | format_str | The format of the string representation (see DateTime::format, might be empty). |
- Returns
- A string representation of the stored date.
- Exceptions
-
std::invalid_argument | If the format string is invalid |
◆ getHour()
Get the hour.
- Returns
- The hour.
◆ getMicrosecond()
int getMicrosecond |
( |
| ) |
const |
Get the microsecond.
- Returns
- [in] The microsecond.
◆ getMinute()
Get the minute.
- Returns
- The minute.
◆ getSecond()
Get the second.
- Returns
- The second.
◆ set() [1/2]
bool set |
( |
const std::string & |
time | ) |
|
Sets the time a given time string.
This string formats are supported: HH:MM:SS
-
HH
Hour in 24-hour format (zero-padded 00..23)
-
MM
Minute as decimal number (zero-padded 00..59)
-
SS
Second as decimal number (zero-padded 00..59)
-
: Separator for hour:minute:second
- Parameters
-
[in] | time | The string contains the given time as string. |
- Returns
false
if the time string format is invalid, true
otherwise
◆ set() [2/2]
void set |
( |
int |
hour, |
|
|
int |
minute, |
|
|
int |
second, |
|
|
int |
microsecond = 0 |
|
) |
| |
Sets the stored time.
- Parameters
-
[in] | hour | The hour. |
[in] | minute | The minute. |
[in] | second | The second. |
[in] | microsecond | The microsecond. |
◆ setHour()
◆ setMicrosecond()
void setMicrosecond |
( |
int |
microsecond | ) |
|
Set the microsecond.
- Parameters
-
[in] | microsecond | The microsecond. |
◆ setMinute()
void setMinute |
( |
int |
minute | ) |
|
Set the minute.
- Parameters
-
◆ setSecond()
void setSecond |
( |
int |
second | ) |
|
Set the second.
- Parameters
-