My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::util::Date Class Reference

Public Member Functions

 Date ()
 
 Date (Date &date)
 
 Date (Date *date)
 
 Date (const Date &date)
 
 Date (std::string date)
 
 Date (int day, std::string month, int year)
 
 Date (double mjd)
 
 Date (unsigned iYear, unsigned dayInYear, unsigned hour, unsigned min, unsigned sec)
 
void initialize (unsigned day, std::string month, int year)
 
virtual ~Date ()
 
std::string mjdToCal ()
 
std::string mjdToArcCal ()
 
std::string mjdToHorizonsCal ()
 
double getMjd ()
 
unsigned year ()
 
std::string month ()
 
unsigned day ()
 
void setTo (std::string date)
 
void setTo (std::string date, std::string time)
 
void setTo (unsigned iYear, unsigned dayInYear, unsigned hour, unsigned min, unsigned sec)
 
void setToDateAndTime (std::string dateAndTime)
 
void setMjd (double mjd)
 
void setTo40mWxString (std::string date)
 
void setToCbassWxString (std::string date)
 
void operator= (std::string start)
 
bool operator> (Date &date)
 
bool operator>= (Date &date)
 
bool operator< (Date &date)
 
bool operator< (const Date &date)
 
bool operator<= (Date &date)
 
bool operator== (Date &date)
 
Date operator- (double days)
 
Date operator- (Date &days)
 
Date operator+ (double days)
 
void operator+= (double days)
 
void addDays (double days)
 
void addHours (double hours)
 
unsigned numberOfDays ()
 
bool isEmpty ()
 
unsigned dayInYear ()
 
double mjd ()
 

Static Public Member Functions

static double calToMjd (int id, int im, int iy)
 
static double calToMjd (unsigned day, std::string month, int year)
 
static double calToMjd (int id, int im, int iy, int hour, int min, int sec)
 
static std::string mjdToCal (double mjd)
 
static std::string mjdToArcCal (double mjd)
 
static std::string mjdToHorizonsCal (double mjd)
 
static void mjdToCalDate (double mjd, unsigned &year, unsigned &month, unsigned &day)
 
static int deltaDays (Date &date1, Date &date2)
 
static unsigned dayInWeek (double mjd)
 

Static Public Attributes

static char * months []
 
static char * days []
 

Friends

std::ostream & operator<< (std::ostream &os, Date &date)
 
std::ostream & operator<< (std::ostream &os, const Date &date)
 

Constructor & Destructor Documentation

Date::Date ( )

Constructor.

....................................................................... Constructors

Date::~Date ( )
virtual

Destructor.

....................................................................... Destructor.

Member Function Documentation

double Date::calToMjd ( int  id,
int  im,
int  iy 
)
static

....................................................................... Convert from calendar date to MJD


s l a C a l d j


Gregorian calendar to Modified Julian Date.

(Includes century default feature: use slaCldj for years before 100AD.)

Given: iy,im,id int year, month, day in Gregorian calendar

Returned: *djm double Modified Julian Date (JD-2400000.5) for 0 hrs *j int status: 0 = ok 1 = bad year (MJD not computed) 2 = bad month (MJD not computed) 3 = bad day (MJD computed)

The year must be -4699 (i.e. 4700BC) to 2049

int Date::deltaDays ( Date date1,
Date date2 
)
static

....................................................................... Subtraction operator for Date.

Date Date::operator+ ( double  days)

....................................................................... Addition operator for Date.

void Date::operator+= ( double  days)

....................................................................... Addition operator for Date.

Date Date::operator- ( double  days)

....................................................................... Subtraction operator for Date.

Date Date::operator- ( Date days)

....................................................................... Subtraction operator for Date.

Member Data Documentation

char * Date::days
static
Initial value:
= {
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
}
char * Date::months
static
Initial value:
= {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
}

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