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 40 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 47 of file gtime.cpp.
◆ Time() [5/6]
Constructor for the given epoch time, using the local timezone.
Definition at line 61 of file gtime.cpp.
◆ Time() [6/6]
Constructor for the current time, using the local timezone.
Definition at line 54 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 125 of file gtime.cpp.
◆ hhmm()
std::string G::Time::hhmm |
( |
const char * |
sep = nullptr | ) |
const |
Returns the hhmm string.
Definition at line 100 of file gtime.cpp.
◆ hhmmss()
std::string G::Time::hhmmss |
( |
const char * |
sep = nullptr | ) |
const |
Returns the hhmmss string.
Definition at line 93 of file gtime.cpp.
◆ hours()
int G::Time::hours |
( |
| ) |
const |
Returns the hours (0 <= h < 24).
Definition at line 68 of file gtime.cpp.
◆ minutes()
int G::Time::minutes |
( |
| ) |
const |
Returns the minutes (0 <= m < 60).
Definition at line 75 of file gtime.cpp.
◆ operator!=()
bool G::Time::operator!= |
( |
const Time & |
other | ) |
const |
Comparison operator.
Definition at line 142 of file gtime.cpp.
◆ operator==()
bool G::Time::operator== |
( |
const Time & |
other | ) |
const |
Comparison operator.
Definition at line 136 of file gtime.cpp.
◆ seconds()
int G::Time::seconds |
( |
| ) |
const |
Returns the seconds (0 <= s <= 61).
Definition at line 82 of file gtime.cpp.
◆ ss()
std::string G::Time::ss |
( |
| ) |
const |
Returns the seconds as a two-digit decimal string.
Definition at line 108 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 115 of file gtime.cpp.
The documentation for this class was generated from the following files:
- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/glib/gtime.h
- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/glib/gtime.cpp