45 EpochTime( std::time_t ,
unsigned long us ) ;
74 std::ostream & operator<<( std::ostream & s ,
const EpochTime & et ) ;
83 G_EXCEPTION( Error ,
"date/time error" ) ;
84 typedef struct std::tm BrokenDownTime ;
85 typedef std::pair<bool,unsigned int> Offset ;
116 static bool equivalent(
EpochTime ,
const BrokenDownTime & ) ;
117 static bool equivalent(
const BrokenDownTime & ,
const BrokenDownTime & ) ;
118 static std::tm * gmtime_imp(
const std::time_t * , std::tm * ) ;
119 static std::tm * localtime_imp(
const std::time_t * , std::tm * ) ;
140 return lhs.s < rhs.s || (lhs.s == rhs.s && lhs.us < rhs.us ) ;
146 return lhs.s == rhs.s && lhs.us == rhs.us ;
152 return !(lhs == rhs) ;
158 return lhs == rhs || lhs < rhs ;
164 return !(lhs < rhs) ;
170 return lhs >= rhs && lhs != rhs ;
174 std::ostream & G::operator<<( std::ostream & s ,
const G::EpochTime & t )
static BrokenDownTime utc(EpochTime epoch_time)
Converts from epoch time to UTC broken-down-time.
A subsecond-resolution timestamp based on a time_t.
static Offset offset(EpochTime epoch_time)
Returns the offset between UTC and localtime as at 'epoch_time'.
static BrokenDownTime local(EpochTime epoch_time)
Converts from epoch time to local broken-down-time.
static EpochTime now()
Returns the current epoch time.
void streamOut(std::ostream &) const
Used by operator<<.
A low-level static class used by Date and Time.
static std::string offsetString(Offset offset)
Converts the given utc/localtime offset into a five-character "+/-hhmm" string.
EpochTime(std::time_t)
Constructor.
static EpochTime epochTime(const BrokenDownTime &broken_down_time)
Converts from UTC broken-down-time to epoch time.