#include <datetime.h>
Inherited by a_util::datetime::DateTime.
|
|
| Time () |
| | Default constructor - initializes the time to 00:00:00,0.
|
| |
| | Time (int hour, int minute, int second, int microsecond=0) |
| |
| void | set (int hour, int minute, int second, int microsecond=0) |
| |
| bool | set (const std::string &time) |
| |
| void | setHour (int hour) |
| |
| int | getHour () const |
| |
| void | setMinute (int minute) |
| |
| int | getMinute () const |
| |
| void | setSecond (int second) |
| |
| int | getSecond () const |
| |
| void | setMicrosecond (int microsecond) |
| |
| int | getMicrosecond () const |
| |
| std::string | format (const std::string &format_str) const |
| |
Time implementation representing a time of day (00:00:00,0 - 23:59:59,999999)
- Warning
- : This class does not enforce time consistency!
◆ Time()
| a_util::datetime::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 a_util::datetime::Time::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()
| int a_util::datetime::Time::getHour |
( |
| ) |
const |
Get the hour.
- Returns
- The hour.
◆ getMicrosecond()
| int a_util::datetime::Time::getMicrosecond |
( |
| ) |
const |
Get the microsecond.
- Returns
- [in] The microsecond.
◆ getMinute()
| int a_util::datetime::Time::getMinute |
( |
| ) |
const |
Get the minute.
- Returns
- The minute.
◆ getSecond()
| int a_util::datetime::Time::getSecond |
( |
| ) |
const |
Get the second.
- Returns
- The second.
◆ set() [1/2]
| bool a_util::datetime::Time::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 a_util::datetime::Time::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()
| void a_util::datetime::Time::setHour |
( |
int | hour | ) |
|
◆ setMicrosecond()
| void a_util::datetime::Time::setMicrosecond |
( |
int | microsecond | ) |
|
Set the microsecond.
- Parameters
-
| [in] | microsecond | The microsecond. |
◆ setMinute()
| void a_util::datetime::Time::setMinute |
( |
int | minute | ) |
|
Set the minute.
- Parameters
-
◆ setSecond()
| void a_util::datetime::Time::setSecond |
( |
int | second | ) |
|
Set the second.
- Parameters
-
The documentation for this class was generated from the following file: