A simple time-of-day (hh/mm/ss) class.
More...
#include <gtime.h>
|
static Time | at (unsigned int) |
| Factory function for a time that is the given number of seconds since midnight (see value()). More...
|
|
A simple time-of-day (hh/mm/ss) class.
- See also
- G::Date, G::DateTime
Definition at line 38 of file gtime.h.
◆ Time() [1/6]
Constructor for the current time, using UTC.
Definition at line 41 of file gtime.cpp.
◆ Time() [2/6]
G::Time::Time |
( |
int |
hh, |
|
|
int |
mm, |
|
|
int |
ss |
|
) |
| |
Constructor for the given time.
Out-of-range values are clamped, with leap seconds allowed only just before midnight.
Definition at line 27 of file gtime.cpp.
◆ Time() [3/6]
Constructor for the given broken-down time.
Definition at line 34 of file gtime.cpp.
◆ Time() [4/6]
Constructor for the given epoch time, using UTC.
Definition at line 46 of file gtime.cpp.
◆ Time() [5/6]
Constructor for the given epoch time, using the local timezone.
Definition at line 56 of file gtime.cpp.
◆ Time() [6/6]
Constructor for the current time, using the local timezone.
Definition at line 51 of file gtime.cpp.
◆ at()
G::Time G::Time::at |
( |
unsigned int |
s | ) |
|
|
static |
Factory function for a time that is the given number of seconds since midnight (see value()).
Values that are out of the normal time-of-day range are clamped, with leap seconds beging lost in the process.
Definition at line 107 of file gtime.cpp.
◆ hhmm()
std::string G::Time::hhmm |
( |
const char * |
sep = nullptr | ) |
const |
Returns the hhmm string.
Definition at line 84 of file gtime.cpp.
◆ hhmmss()
std::string G::Time::hhmmss |
( |
const char * |
sep = nullptr | ) |
const |
Returns the hhmmss string.
Definition at line 76 of file gtime.cpp.
◆ hours()
int G::Time::hours |
( |
| ) |
const |
Returns the hours (0 <= h < 24).
Definition at line 61 of file gtime.cpp.
◆ minutes()
int G::Time::minutes |
( |
| ) |
const |
Returns the minutes (0 <= m < 60).
Definition at line 66 of file gtime.cpp.
◆ operator!=()
bool G::Time::operator!= |
( |
const Time & |
other | ) |
const |
Comparison operator.
Definition at line 122 of file gtime.cpp.
◆ operator==()
bool G::Time::operator== |
( |
const Time & |
other | ) |
const |
Comparison operator.
Definition at line 117 of file gtime.cpp.
◆ seconds()
int G::Time::seconds |
( |
| ) |
const |
Returns the seconds (0 <= s <= 61).
Definition at line 71 of file gtime.cpp.
◆ ss()
std::string G::Time::ss |
( |
| ) |
const |
Returns the seconds as a two-digit decimal string.
Definition at line 92 of file gtime.cpp.
◆ value()
unsigned int G::Time::value |
( |
| ) |
const |
Returns the time as the number of seconds since midnight (ignoring leap seconds).
Definition at line 99 of file gtime.cpp.
The documentation for this class was generated from the following files:
- /usr/src/slapt-src-x86_64/network/emailrelay/emailrelay-2.3/src/glib/gtime.h
- /usr/src/slapt-src-x86_64/network/emailrelay/emailrelay-2.3/src/glib/gtime.cpp