VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
G::DateTime Class Reference

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

#include <gdatetime.h>

Public Types

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'. More...
 
static std::string offsetString (Offset offset)
 Converts the given utc/localtime offset into a five-character "+/-hhmm" string. More...
 
static std::string offsetString (int hh)
 Overload for a signed integer timezone.
 

Detailed Description

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

Definition at line 80 of file gdatetime.h.

Member Function Documentation

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 139 of file gdatetime.cpp.

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 158 of file gdatetime.cpp.


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