G::DateTime Class Reference

A low-level static class used by Date and Time. More...

#include <gdatetime.h>

List of all members.

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.
static EpochTime epochTime (const BrokenDownTime &broken_down_time)
 Converts from UTC broken-down-time to epoch time.
static BrokenDownTime utc (EpochTime epoch_time)
 Converts from epoch time to UTC broken-down-time.
static BrokenDownTime local (EpochTime epoch_time)
 Converts from epoch time to local broken-down-time.
static Offset offset (EpochTime epoch_time)
 Returns the offset between UTC and localtime as at 'epoch_time'.
static std::string offsetString (Offset offset)
 Converts the given utc/localtime offset into a five-character "+/-hhmm" string.


Detailed Description

A low-level static class used by Date and Time.

Definition at line 38 of file gdatetime.h.


Member Typedef Documentation

typedef std::time_t G::DateTime::EpochTime

Definition at line 41 of file gdatetime.h.

typedef struct std::tm G::DateTime::BrokenDownTime [read]

Definition at line 43 of file gdatetime.h.

typedef std::pair<bool,unsigned int> G::DateTime::Offset

Definition at line 44 of file gdatetime.h.


Member Function Documentation

G::DateTime::EpochTime G::DateTime::now (  )  [static]

G::DateTime::EpochTime G::DateTime::epochTime ( const BrokenDownTime broken_down_time  )  [static]

Converts from UTC broken-down-time to epoch time.

Definition at line 39 of file gdatetime.cpp.

Referenced by offset(), and G::Date::weekday().

G::DateTime::BrokenDownTime G::DateTime::utc ( EpochTime  epoch_time  )  [static]

Converts from epoch time to UTC broken-down-time.

Definition at line 55 of file gdatetime.cpp.

References result.

Referenced by G::Date::Date(), G::Time::Time(), and G::Date::weekday().

G::DateTime::BrokenDownTime G::DateTime::local ( EpochTime  epoch_time  )  [static]

Converts from epoch time to local broken-down-time.

Definition at line 62 of file gdatetime.cpp.

Referenced by G::Date::Date(), offset(), GSmtp::ServerProtocolText::receivedLine(), and G::Time::Time().

G::DateTime::Offset G::DateTime::offset ( EpochTime  epoch_time  )  [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 69 of file gdatetime.cpp.

References epochTime(), and local().

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

std::string G::DateTime::offsetString ( Offset  offset  )  [static]

Converts the given utc/localtime offset into a five-character "+/-hhmm" string.

See also RFC2822.

Definition at line 79 of file gdatetime.cpp.

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


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

Generated on Fri Apr 18 15:56:13 2008 for E-MailRelay by  doxygen 1.5.5