51#ifndef HEADER_INCLUDED__SAGA_API__datetime_H
52#define HEADER_INCLUDED__SAGA_API__datetime_H
102 m_span = msec + 1000 * (sec + 60 * ((
sLong)min + 60 * (
sLong)hours));
142 bool is_Null (
void)
const {
return( m_span == 0l ); }
146 bool operator ! (
void)
const {
return( !
is_Null() ); }
152 bool operator < (
const CSG_TimeSpan &ts)
const {
return( m_span < ts.m_span ); }
153 bool operator <= (
const CSG_TimeSpan &ts)
const {
return( m_span <= ts.m_span ); }
154 bool operator == (
const CSG_TimeSpan &ts)
const {
return( m_span == ts.m_span ); }
155 bool operator != (
const CSG_TimeSpan &ts)
const {
return( m_span != ts.m_span ); }
156 bool operator >= (
const CSG_TimeSpan &ts)
const {
return( m_span >= ts.m_span ); }
157 bool operator > (
const CSG_TimeSpan &ts)
const {
return( m_span > ts.m_span ); }
197 Jan,
Feb,
Mar,
Apr,
May,
Jun,
Jul,
Aug,
Sep,
Oct,
Nov,
Dec,
Inv_Month
224 CSG_DateTime( TSG_DateTime Hour , TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
225 CSG_DateTime(TSG_DateTime Day, Month Month,
int Year = Inv_Year, TSG_DateTime Hour = 0, TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
234 CSG_DateTime & Set ( TSG_DateTime Hour , TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
235 CSG_DateTime & Set (TSG_DateTime Day, Month Month,
int Year = Inv_Year, TSG_DateTime Hour = 0, TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
261 bool is_DST (
void)
const;
275 bool is_Valid (
void)
const;
277 sLong Get_Value (
void)
const;
279 unsigned short Get_Millisecond (
void)
const;
280 unsigned short Get_Second (
void)
const;
281 unsigned short Get_Minute (
void)
const;
282 unsigned short Get_Hour (
void)
const;
284 unsigned short Get_Day (
void)
const;
285 Month Get_Month (
void)
const;
286 int Get_Year (
void)
const;
288 unsigned short Get_DayOfYear (
void)
const;
289 WeekDay Get_WeekDay (
void)
const;
290 TSG_DateTime Get_WeekOfMonth (
void)
const;
291 TSG_DateTime Get_WeekOfYear (
void)
const;
293 double Get_JDN (
void)
const;
294 double Get_MJD (
void)
const;
295 sLong Get_Unix_Time (
void)
const;
299 bool is_EarlierThan (
const CSG_DateTime &DateTime)
const;
335 CSG_String Format_ISOCombined (
char sep =
'T')
const;
338 bool Parse_DateTime (
const CSG_String &datetime);
342 bool Parse_ISOCombined (
const CSG_String &date,
char sep=
'T');
348 static TSG_DateTime Get_Current_Day (
void);
349 static Month Get_Current_Month (
void);
350 static int Get_Current_Year (
void);
352 static CSG_String Get_MonthName (Month month, NameFlags flags = Name_Full);
353 static CSG_String Get_EnglishMonthName (Month month, NameFlags flags = Name_Full);
354 static CSG_String Get_WeekDayName (WeekDay weekday, NameFlags flags = Name_Full);
355 static CSG_String Get_EnglishWeekDayName (WeekDay weekday, NameFlags flags = Name_Full);
357 static TSG_DateTime Get_NumberOfDays (
int year);
358 static TSG_DateTime Get_NumberOfDays (Month month,
int year = Inv_Year);
360 static bool is_LeapYear (
int year = Inv_Year);
369 class wxDateTime *m_pDateTime;
#define SAGA_API_DLL_EXPORT
SAGA_API_DLL_EXPORT CSG_String operator+(const char *A, const CSG_String &B)
CSG_DateTime Add(const CSG_TimeSpan &TimeSpan) const
sLong Get_Value(void) const
unsigned short TSG_DateTime
CSG_DateTime Subtract(const CSG_TimeSpan &TimeSpan) const
CSG_DateTime & Set(const CSG_DateTime &DateTime)
static CSG_TimeSpan Second(void)
static CSG_TimeSpan Days(long days)
CSG_TimeSpan(double hours)
CSG_TimeSpan(const CSG_TimeSpan &ts)
int Get_Minutes(void) const
bool is_ShorterThan(const CSG_TimeSpan &ts) const
CSG_TimeSpan & Subtract(const CSG_TimeSpan &ts)
CSG_TimeSpan(long hours, long min=0, sLong sec=0, sLong msec=0)
CSG_TimeSpan & Add(const CSG_TimeSpan &ts)
static CSG_TimeSpan Minute(void)
CSG_TimeSpan & Multiply(int n)
static CSG_TimeSpan Hours(long hours)
CSG_TimeSpan Negate(void) const
static CSG_TimeSpan Hour(void)
int Get_Weeks(void) const
bool is_Positive(void) const
bool is_EqualTo(const CSG_TimeSpan &ts) const
CSG_TimeSpan Add(const CSG_TimeSpan &ts) const
CSG_TimeSpan Subtract(const CSG_TimeSpan &ts) const
CSG_TimeSpan(const sLong &diff)
static CSG_TimeSpan Millisecond(void)
sLong Get_Value(void) const
static CSG_TimeSpan Day(void)
static CSG_TimeSpan Seconds(sLong sec)
sLong Get_Milliseconds(void) const
sLong Get_Seconds(void) const
int Get_Hours(void) const
bool is_LongerThan(const CSG_TimeSpan &ts) const
friend class CSG_DateTime
static CSG_TimeSpan Minutes(long min)
static CSG_TimeSpan Milliseconds(sLong ms)
bool is_Negative(void) const
static CSG_TimeSpan Weeks(long days)
static CSG_TimeSpan Week(void)
CSG_TimeSpan Multiply(int n) const
CSG_TimeSpan Abs(void) const
SAGA_API_DLL_EXPORT double SG_Get_Sun_Refraction(double Height, bool bRadians)
SAGA_API_DLL_EXPORT double SG_Get_Day_Length(int DayOfYear, double Latitude)
SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position(double JulianDayNumber, double &RA, double &Dec)
SAGA_API_DLL_EXPORT bool SG_JulianDayNumber_To_Date(double JDN, int &y, int &m, int &d)
SAGA_API_DLL_EXPORT double SG_Date_To_JulianDayNumber(int y, int m, int d)
SAGA_API_DLL_EXPORT int SG_Get_Day_MidOfMonth(int Month, bool bLeapYear=false)
CSG_Vector operator*(double Scalar, const CSG_Vector &Vector)