A time is a specific time of the day specified in terms of an hour, minute, second, and microsecond (0-999999). It can also be initialized as a fraction of a day using time::from_number.
More...
#include <time.hpp>
|
| time (int hour_=0, int minute_=0, int second_=0, int microsecond_=0) |
| Constructs a time object from an optional hour, minute, second, and microsecond. More...
|
|
| time (const std::string &time_string) |
| Constructs a time object from a string representing the time. More...
|
|
double | to_number () const |
| Returns a numeric representation of the time in the range 0-1 where the value is equal to the fraction of the day elapsed. More...
|
|
bool | operator== (const time &comparand) const |
| Returns true if this time is equivalent to comparand. More...
|
|
|
static time | now () |
| Returns the current time according to the system time. More...
|
|
static time | from_number (double number) |
| Returns a time from a number representing a fraction of a day. The integer part of number will be ignored. 0.5 would return time(12, 0, 0, 0) or noon, halfway through the day. More...
|
|
A time is a specific time of the day specified in terms of an hour, minute, second, and microsecond (0-999999). It can also be initialized as a fraction of a day using time::from_number.
◆ time() [1/2]
xlnt::time::time |
( |
int |
hour_ = 0 , |
|
|
int |
minute_ = 0 , |
|
|
int |
second_ = 0 , |
|
|
int |
microsecond_ = 0 |
|
) |
| |
|
explicit |
Constructs a time object from an optional hour, minute, second, and microsecond.
◆ time() [2/2]
xlnt::time::time |
( |
const std::string & |
time_string | ) |
|
|
explicit |
Constructs a time object from a string representing the time.
◆ from_number()
static time xlnt::time::from_number |
( |
double |
number | ) |
|
|
static |
Returns a time from a number representing a fraction of a day. The integer part of number will be ignored. 0.5 would return time(12, 0, 0, 0) or noon, halfway through the day.
◆ now()
static time xlnt::time::now |
( |
| ) |
|
|
static |
Returns the current time according to the system time.
◆ operator==()
bool xlnt::time::operator== |
( |
const time & |
comparand | ) |
const |
Returns true if this time is equivalent to comparand.
◆ to_number()
double xlnt::time::to_number |
( |
| ) |
const |
Returns a numeric representation of the time in the range 0-1 where the value is equal to the fraction of the day elapsed.
◆ hour
◆ microsecond
int xlnt::time::microsecond = 0 |
◆ minute
int xlnt::time::minute = 0 |
◆ second
int xlnt::time::second = 0 |
The documentation for this struct was generated from the following file: