- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Classes | Public Member Functions | List of all members
G::Time Class Reference

A simple time-of-day (hh/mm/ss) class. More...

`#include <gtime.h>`

## Classes
class | LocalTime
| An overload discriminator class for Time constructors. More...

## Public Member Functions
| Time ()
| Constructor, using UTC, for now. More...
| Time (const G::DateTime::BrokenDownTime &tm)
| Constructor for the given broken-down time. More...
| Time (G::DateTime::EpochTime t)
| Constructor, using UTC, for the given epoch time. More...
| Time (G::DateTime::EpochTime t, const LocalTime &)
| Constructor, using the local timezone, for the given epoch time. More...
| Time (const LocalTime &)
| Localtime constructor for now. More...
int | hours () const
| Returns the hours (0 <= h < 24). More...
int | minutes () const
| Returns the minutes (0 <= m < 60). More...
int | seconds () const
| Returns the seconds (0 <= s <= 61 [sic]). More...
std::string | hhmmss (const char *sep=NULL) const
| Returns a hhmmss string. More...
std::string | hhmm (const char *sep=NULL) const
| Returns a hhmm string. More...
std::string | ss () const
| Returns the seconds as a two-digit decimal seconds. More...

## Detailed Description

A simple time-of-day (hh/mm/ss) class.

See also
  G::Date, G::DateTime

Definition at line 39 of file gtime.h.

## Constructor & Destructor Documentation

G::Time::Time | ( |  | ) |

Constructor, using UTC, for now.

Definition at line 33 of file gtime.cpp.

References G::DateTime::now(), and G::DateTime::utc().

G::Time::Time | ( | const G::DateTime::BrokenDownTime & | tm | ) |
| explicit

Constructor for the given broken-down time.

Definition at line 26 of file gtime.cpp.

G::Time::Time | ( | G::DateTime::EpochTime | t | ) |
| explicit

Constructor, using UTC, for the given epoch time.

Definition at line 41 of file gtime.cpp.

References G::DateTime::utc().

G::Time::Time | ( | G::DateTime::EpochTime | t,
|  | const LocalTime & |
| ) |  |

Constructor, using the local timezone, for the given epoch time.

Definition at line 57 of file gtime.cpp.

References G::DateTime::local().

G::Time::Time | ( | const LocalTime & |  | ) |
| explicit

Localtime constructor for now.

Definition at line 49 of file gtime.cpp.

References G::DateTime::local(), and G::DateTime::now().

## Member Function Documentation

std::string G::Time::hhmm | ( | const char * | sep = `NULL` | ) | const

Returns a hhmm string.

Definition at line 88 of file gtime.cpp.

std::string G::Time::hhmmss | ( | const char * | sep = `NULL` | ) | const

Returns a hhmmss string.

Definition at line 80 of file gtime.cpp.

Referenced by GSmtp::ServerProtocolText::receivedLine().

int G::Time::hours | ( |  | ) | const

Returns the hours (0 <= h < 24).

Definition at line 65 of file gtime.cpp.

int G::Time::minutes | ( |  | ) | const

Returns the minutes (0 <= m < 60).

Definition at line 70 of file gtime.cpp.

int G::Time::seconds | ( |  | ) | const

Returns the seconds (0 <= s <= 61 [sic]).

Definition at line 75 of file gtime.cpp.

std::string G::Time::ss | ( |  | ) | const

Returns the seconds as a two-digit decimal seconds.

Definition at line 96 of file gtime.cpp.

The documentation for this class was generated from the following files:

- gtime.h
- gtime.cpp