A low-level static class used by Date and Time. More...
#include <gdatetime.h>
Public Types | |
typedef std::time_t | EpochTime |
typedef struct std::tm | BrokenDownTime |
typedef std::pair< bool, unsigned int > | Offset |
Static Public Member Functions | |
static EpochTime | now () |
Returns the current epoch time. More... | |
static EpochTime | epochTime (const BrokenDownTime &broken_down_time) |
Converts from UTC broken-down-time to epoch time. More... | |
static BrokenDownTime | utc (EpochTime epoch_time) |
Converts from epoch time to UTC broken-down-time. More... | |
static BrokenDownTime | local (EpochTime epoch_time) |
Converts from epoch time to local broken-down-time. More... | |
static Offset | offset (EpochTime epoch_time) |
Returns the offset between UTC and localtime as at 'epoch_time'. More... | |
static std::string | offsetString (Offset offset) |
Converts the given utc/localtime offset into a five-character "+/-hhmm" string. More... | |
A low-level static class used by Date and Time.
Definition at line 38 of file gdatetime.h.
typedef struct std::tm G::DateTime::BrokenDownTime |
Definition at line 43 of file gdatetime.h.
typedef std::time_t G::DateTime::EpochTime |
Definition at line 41 of file gdatetime.h.
typedef std::pair<bool,unsigned int> G::DateTime::Offset |
Definition at line 44 of file gdatetime.h.
|
static |
Converts from UTC broken-down-time to epoch time.
Definition at line 39 of file gdatetime.cpp.
Referenced by G::Date::weekday().
|
static |
Converts from epoch time to local broken-down-time.
Definition at line 63 of file gdatetime.cpp.
Referenced by G::Date::Date(), GSmtp::ServerProtocolText::receivedLine(), and G::Time::Time().
|
static |
Returns the current epoch time.
Definition at line 34 of file gdatetime.cpp.
Referenced by G::Date::Date(), GNet::TimerList::doTimeouts(), GSmtp::FileStore::FileStore(), GAuth::SaslServerBasicImp::init(), GNet::TimerList::interval(), GSmtp::ServerProtocolText::receivedLine(), GNet::AbstractTimer::startTimer(), G::Time::Time(), G::Directory::tmp(), and GNet::ResolverInfo::update().
|
static |
Returns the offset between UTC and localtime as at 'epoch_time'.
The returned pair has 'first' set to true if localtime is ahead of (ie. east of) UTC.
(Note that this may be a relatively expensive operation.)
Definition at line 71 of file gdatetime.cpp.
Referenced by GSmtp::ServerProtocolText::receivedLine().
|
static |
Converts the given utc/localtime offset into a five-character "+/-hhmm" string.
See also RFC2822.
Definition at line 81 of file gdatetime.cpp.
Referenced by GSmtp::ServerProtocolText::receivedLine().
|
static |
Converts from epoch time to UTC broken-down-time.
Definition at line 55 of file gdatetime.cpp.
Referenced by G::Date::Date(), G::Time::Time(), and G::Date::weekday().