1 #ifndef SZA_UTIL_DATE_H
2 #define SZA_UTIL_DATE_H
25 Date(
const Date& date);
26 Date(std::string date);
27 Date(
int day, std::string month,
int year);
30 void initialize(
unsigned day, std::string month,
int year);
37 static double calToMjd(
int iy,
int im,
int id);
38 static double calToMjd(
unsigned day, std::string month,
int year);
39 static double calToMjd(
int iy,
int im,
int id,
int hour,
int min,
int sec);
41 static std::string mjdToCal(
double mjd);
42 std::string mjdToCal();
44 static std::string mjdToArcCal(
double mjd);
45 std::string mjdToArcCal();
47 static std::string mjdToHorizonsCal(
double mjd);
48 std::string mjdToHorizonsCal();
50 static void mjdToCalDate(
double mjd,
51 unsigned& year,
unsigned& month,
unsigned& day);
53 static std::string mjdToBuildTime(
double mjd);
54 static std::string mjdToBuildDate(
double mjd);
64 void setTo(std::string date);
65 void setTo(std::string date, std::string time);
66 void setToDateAndTime(std::string dateAndTime);
70 void operator=(std::string start);
72 bool operator>(Date& date);
73 bool operator>=(Date& date);
74 bool operator<(Date& date);
75 bool operator<(
const Date& date);
76 bool operator<=(Date& date);
77 bool operator==(Date& date);
78 Date operator-(
double days);
79 Date operator-(Date& days);
80 Date operator+(
double days);
81 void operator+=(
double days);
83 friend std::ostream& operator<<(std::ostream& os, Date& date);
84 friend std::ostream& operator<<(std::ostream& os,
const Date& date);
86 static int deltaDays(Date& date1, Date& date2);
88 static const char* months[];
90 void addDays(
double days);
91 void addHours(
double hours);
93 unsigned numberOfDays();
107 static void slaDjcal(
int ndp,
double djm,
int iymdf[4]);
108 static void slaDjcl(
double djm,
int* iy,
int* im,
int*
id,
double* df,
int* status);
109 static void slaClyd(
int iy,
int im,
int id,
int *ny,
int *nd,
int *jstat );
111 static unsigned validateMonth(std::string month);
112 static unsigned validateDay(
unsigned day, std::string month);
113 static int validateYear(
int year);
120 #endif // End #ifndef SZA_UTIL_DATE_H