List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Static Private Member Functions | Private Attributes | Friends
utl::UTCDate Class Reference

#include <utl/UTCDate.h>

Inheritance diagram for utl::UTCDate:
Inheritance graph
[legend]

Public Types

enum  Month {
  eJan = 1, eFeb = 2, eMar = 3, eApr = 4,
  eMay = 5, eJun = 6, eJul = 7, eAug = 8,
  eSep = 9, eOct = 10, eNov = 11, eDec = 12
}
 

Public Member Functions

int GetDay () const
 
std::string GetInAugerFormat () const
 
std::string GetInXMLFormat () const
 
int GetMonth () const
 
std::time_t GetUnixSecond () const
 Relative to Unix epoch (1 Jan 1970 00:00:00 UTC) without leap corrections. More...
 
int GetYear () const
 
 operator bool () const
 
bool operator!= (const UTCDate &d) const
 
bool operator== (const UTCDate &d) const
 
void Set (const int year, const int month, const int day)
 
 UTCDate ()
 
 UTCDate (const int year, const int month, const int day)
 Jan = 1, Dec = 12. More...
 

Static Public Member Functions

static UTCDate GetGPSEpoch ()
 
static UTCDate GetUnixEpoch ()
 

Protected Member Functions

std::string GetInXMLFormatZone (const char *const zone) const
 
std::istream & Parse (std::istream &is, const bool zone=true)
 

Static Protected Member Functions

static std::time_t GetUnixSecond (const int year, const int month, const int day, const int hour, const int minute, const int second)
 

Static Protected Attributes

static const char *const fgMonthNames []
 

Static Private Member Functions

static bool IsLeapYear (const int year)
 
static int NumberOfDaysInMonth (const int year, const int month)
 

Private Attributes

int fDay
 
int fMonth
 
int fYear
 

Friends

std::istream & operator>> (std::istream &, UTCDate &)
 read from XML schema type "Date" (any timezone) compliant format More...
 

Detailed Description

Author
Darko Veberic
Date
22 Jul 2009

Definition at line 19 of file UTCDate.h.

Member Enumeration Documentation

Enumerator
eJan 
eFeb 
eMar 
eApr 
eMay 
eJun 
eJul 
eAug 
eSep 
eOct 
eNov 
eDec 

Definition at line 21 of file UTCDate.h.

Constructor & Destructor Documentation

utl::UTCDate::UTCDate ( )
inline

Definition at line 36 of file UTCDate.h.

Referenced by GetGPSEpoch(), and GetUnixEpoch().

utl::UTCDate::UTCDate ( const int  year,
const int  month,
const int  day 
)
inline

Jan = 1, Dec = 12.

Definition at line 39 of file UTCDate.h.

References Set().

Member Function Documentation

int utl::UTCDate::GetDay ( ) const
inline
static UTCDate utl::UTCDate::GetGPSEpoch ( )
inlinestatic
string UTCDate::GetInAugerFormat ( ) const

Definition at line 70 of file UTCDate.cc.

std::string utl::UTCDate::GetInXMLFormat ( ) const
inline

Definition at line 52 of file UTCDate.h.

References GetInXMLFormatZone().

Referenced by utl::operator<<().

string UTCDate::GetInXMLFormatZone ( const char *const  zone) const
protected

Definition at line 83 of file UTCDate.cc.

Referenced by GetInXMLFormat().

int utl::UTCDate::GetMonth ( ) const
inline
static UTCDate utl::UTCDate::GetUnixEpoch ( )
inlinestatic

Definition at line 65 of file UTCDate.h.

References eJan, and UTCDate().

Referenced by utl::UTCDateTime::GetUnixEpoch().

std::time_t utl::UTCDate::GetUnixSecond ( ) const
inline

Relative to Unix epoch (1 Jan 1970 00:00:00 UTC) without leap corrections.

Definition at line 68 of file UTCDate.h.

References fDay, fMonth, and fYear.

Referenced by utl::UTCDateTime::GetUnixSecond(), utl::LeapSeconds::Init(), and TestTime::TestUTCToGPSLeapSeconds().

time_t UTCDate::GetUnixSecond ( const int  year,
const int  month,
const int  day,
const int  hour,
const int  minute,
const int  second 
)
staticprotected

Definition at line 46 of file UTCDate.cc.

References utl::day, utl::hour, utl::minute, and galactic::second.

int utl::UTCDate::GetYear ( ) const
inline
static bool utl::UTCDate::IsLeapYear ( const int  year)
inlinestaticprivate

Definition at line 82 of file UTCDate.h.

Referenced by NumberOfDaysInMonth().

static int utl::UTCDate::NumberOfDaysInMonth ( const int  year,
const int  month 
)
inlinestaticprivate

Definition at line 87 of file UTCDate.h.

References eApr, eAug, eDec, eFeb, eJan, eJul, eJun, eMar, eMay, eNov, eOct, eSep, and IsLeapYear().

utl::UTCDate::operator bool ( ) const
inlineexplicit

Definition at line 55 of file UTCDate.h.

References fDay, fMonth, and fYear.

bool utl::UTCDate::operator!= ( const UTCDate d) const
inline

Definition at line 60 of file UTCDate.h.

References operator==().

bool utl::UTCDate::operator== ( const UTCDate d) const
inline

Definition at line 57 of file UTCDate.h.

References fDay, fMonth, and fYear.

Referenced by operator!=().

istream & UTCDate::Parse ( std::istream &  is,
const bool  zone = true 
)
protected

Definition at line 97 of file UTCDate.cc.

References utl::day, ERROR, is(), and galactic::year.

Referenced by utl::operator>>().

void UTCDate::Set ( const int  year,
const int  month,
const int  day 
)

Definition at line 19 of file UTCDate.cc.

References utl::day, ERROR, and galactic::year.

Referenced by utl::UTCDateTime::Set(), and UTCDate().

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  is,
UTCDate date 
)
friend

read from XML schema type "Date" (any timezone) compliant format

Definition at line 124 of file UTCDate.h.

Member Data Documentation

int utl::UTCDate::fDay
private

Definition at line 112 of file UTCDate.h.

Referenced by GetDay(), GetUnixSecond(), operator bool(), and operator==().

const char *const UTCDate::fgMonthNames
staticprotected
Initial value:
= {
"JAN", "FEB", "MAR", "APR", "MAY", "JUN",
"JUL", "AUG", "SEP", "OCT", "NOV", "DEC"
}

Definition at line 72 of file UTCDate.h.

int utl::UTCDate::fMonth
private

Definition at line 111 of file UTCDate.h.

Referenced by GetMonth(), GetUnixSecond(), operator bool(), and operator==().

int utl::UTCDate::fYear
private

Definition at line 110 of file UTCDate.h.

Referenced by GetUnixSecond(), GetYear(), operator bool(), and operator==().


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

, generated on Tue Sep 26 2023.