SAGA API
v9.6
|
#include <datetime.h>
Public Types | |
enum | Month { Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, Inv_Month } |
enum | WeekDay { Sun, Mon, Tue, Wed, Thu, Fri, Sat, Inv_WeekDay } |
enum | Year { Inv_Year = -32768 } |
enum | NameFlags { Name_Full = 0x01, Name_Abbr = 0x02 } |
typedef unsigned short | TSG_DateTime |
Public Member Functions | |
CSG_DateTime (void) | |
CSG_DateTime (const CSG_DateTime &DateTime) | |
CSG_DateTime (const CSG_String &ISODate) | |
CSG_DateTime (double JDN) | |
CSG_DateTime (TSG_DateTime Hour, TSG_DateTime Minute=0, TSG_DateTime Second=0, TSG_DateTime Millisec=0) | |
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) | |
virtual | ~CSG_DateTime (void) |
CSG_DateTime & | Set (const CSG_DateTime &DateTime) |
CSG_DateTime & | Set (const CSG_String &ISODate) |
CSG_DateTime & | Set (double JDN) |
CSG_DateTime & | Set (TSG_DateTime Hour, TSG_DateTime Minute=0, TSG_DateTime Second=0, TSG_DateTime Millisec=0) |
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) |
CSG_DateTime & | Set_Millisecond (unsigned short Value) |
CSG_DateTime & | Set_Second (unsigned short Value) |
CSG_DateTime & | Set_Minute (unsigned short Value) |
CSG_DateTime & | Set_Hour (unsigned short Value) |
CSG_DateTime & | Set_Hour (double Value) |
CSG_DateTime & | Set_Day (unsigned short Value) |
CSG_DateTime & | Set_Month (unsigned short Value) |
CSG_DateTime & | Set_Year (int Value) |
CSG_DateTime & | Set_DayOfYear (unsigned short Value) |
CSG_DateTime & | Set_To_Current (void) |
CSG_DateTime & | Set_Unix_Time (sLong Seconds) |
CSG_DateTime & | Set_Hours_AD (int Hours) |
CSG_DateTime & | Reset_Time (void) |
CSG_DateTime | From_UTC (bool noDST=false) const |
CSG_DateTime | To_UTC (bool noDST=false) const |
CSG_DateTime & | Make_UTC (bool noDST=false) |
bool | is_DST (void) const |
CSG_DateTime | Add (const CSG_TimeSpan &TimeSpan) const |
CSG_DateTime & | Add (const CSG_TimeSpan &TimeSpan) |
CSG_DateTime | Subtract (const CSG_TimeSpan &TimeSpan) const |
CSG_DateTime & | Subtract (const CSG_TimeSpan &TimeSpan) |
CSG_TimeSpan | Subtract (const CSG_DateTime &DateTime) const |
bool | is_Valid (void) const |
sLong | Get_Value (void) const |
unsigned short | Get_Millisecond (void) const |
unsigned short | Get_Second (void) const |
unsigned short | Get_Minute (void) const |
unsigned short | Get_Hour (void) const |
unsigned short | Get_Day (void) const |
Month | Get_Month (void) const |
int | Get_Year (void) const |
unsigned short | Get_DayOfYear (void) const |
WeekDay | Get_WeekDay (void) const |
TSG_DateTime | Get_WeekOfMonth (void) const |
TSG_DateTime | Get_WeekOfYear (void) const |
double | Get_JDN (void) const |
double | Get_MJD (void) const |
bool | is_EarlierThan (const CSG_DateTime &DateTime) const |
bool | is_EqualTo (const CSG_DateTime &DateTime) const |
bool | is_LaterThan (const CSG_DateTime &DateTime) const |
bool | is_SameDate (const CSG_DateTime &DateTime) const |
bool | is_SameTime (const CSG_DateTime &DateTime) const |
bool | is_Between (const CSG_DateTime &t1, const CSG_DateTime &t2) const |
bool | is_StrictlyBetween (const CSG_DateTime &t1, const CSG_DateTime &t2) const |
CSG_DateTime & | operator= (const CSG_DateTime &DateTime) |
CSG_DateTime & | operator= (double JDN) |
CSG_DateTime & | operator+= (const CSG_TimeSpan &TimeSpan) |
CSG_DateTime & | operator-= (const CSG_TimeSpan &TimeSpan) |
CSG_DateTime | operator+ (const CSG_TimeSpan &TimeSpan) const |
CSG_DateTime | operator- (const CSG_TimeSpan &TimeSpan) const |
CSG_TimeSpan | operator- (const CSG_DateTime &DateTime) const |
bool | operator< (const CSG_DateTime &DateTime) const |
bool | operator<= (const CSG_DateTime &DateTime) const |
bool | operator== (const CSG_DateTime &DateTime) const |
bool | operator>= (const CSG_DateTime &DateTime) const |
bool | operator> (const CSG_DateTime &DateTime) const |
CSG_String | Format (const CSG_String &Format="") const |
CSG_String | Format_Date (void) const |
CSG_String | Format_Time (void) const |
CSG_String | Format_ISODate (void) const |
CSG_String | Format_ISOTime (void) const |
CSG_String | Format_ISOCombined (char sep='T') const |
bool | Parse_Date (const CSG_String &date) |
bool | Parse_DateTime (const CSG_String &datetime) |
bool | Parse_Format (const CSG_String &date, const CSG_String &format, const CSG_DateTime &dateDef) |
bool | Parse_Format (const CSG_String &date, const CSG_String &format) |
bool | Parse_Format (const CSG_String &date) |
bool | Parse_ISOCombined (const CSG_String &date, char sep='T') |
bool | Parse_ISODate (const CSG_String &date) |
bool | Parse_ISOTime (const CSG_String &date) |
Static Public Member Functions | |
static TSG_DateTime | Get_Current_Day (void) |
static Month | Get_Current_Month (void) |
static int | Get_Current_Year (void) |
static CSG_String | Get_MonthName (Month month, NameFlags flags=Name_Full) |
static CSG_String | Get_EnglishMonthName (Month month, NameFlags flags=Name_Full) |
static CSG_String | Get_WeekDayName (WeekDay weekday, NameFlags flags=Name_Full) |
static CSG_String | Get_EnglishWeekDayName (WeekDay weekday, NameFlags flags=Name_Full) |
static TSG_DateTime | Get_NumberOfDays (int year) |
static TSG_DateTime | Get_NumberOfDays (Month month, int year=Inv_Year) |
static bool | is_LeapYear (int year=Inv_Year) |
static CSG_DateTime | Now (void) |
static CSG_String | Get_Month_Choices (void) |
Definition at line 182 of file datetime.h.
typedef unsigned short CSG_DateTime::TSG_DateTime |
Definition at line 189 of file datetime.h.
enum CSG_DateTime::Month |
Enumerator | |
---|---|
Jan | |
Feb | |
Mar | |
Apr | |
May | |
Jun | |
Jul | |
Aug | |
Sep | |
Oct | |
Nov | |
Dec | |
Inv_Month |
Definition at line 195 of file datetime.h.
Enumerator | |
---|---|
Name_Full | |
Name_Abbr |
Definition at line 210 of file datetime.h.
Enumerator | |
---|---|
Sun | |
Mon | |
Tue | |
Wed | |
Thu | |
Fri | |
Sat | |
Inv_WeekDay |
Definition at line 200 of file datetime.h.
enum CSG_DateTime::Year |
Enumerator | |
---|---|
Inv_Year |
Definition at line 205 of file datetime.h.
CSG_DateTime::CSG_DateTime | ( | void | ) |
Definition at line 82 of file datetime.cpp.
Referenced by From_UTC(), and To_UTC().
CSG_DateTime::CSG_DateTime | ( | const CSG_DateTime & | DateTime | ) |
Definition at line 88 of file datetime.cpp.
CSG_DateTime::CSG_DateTime | ( | const CSG_String & | ISODate | ) |
Definition at line 100 of file datetime.cpp.
References Set().
CSG_DateTime::CSG_DateTime | ( | double | JDN | ) |
Definition at line 94 of file datetime.cpp.
CSG_DateTime::CSG_DateTime | ( | TSG_DateTime | Hour, |
TSG_DateTime | Minute = 0 , |
||
TSG_DateTime | Second = 0 , |
||
TSG_DateTime | Millisec = 0 |
||
) |
Definition at line 108 of file datetime.cpp.
CSG_DateTime::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 |
||
) |
Definition at line 114 of file datetime.cpp.
|
virtual |
Definition at line 120 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Add | ( | const CSG_TimeSpan & | TimeSpan | ) |
Definition at line 331 of file datetime.cpp.
CSG_DateTime CSG_DateTime::Add | ( | const CSG_TimeSpan & | TimeSpan | ) | const |
Definition at line 324 of file datetime.cpp.
References Add().
Referenced by Add(), and CSG_TimeSpan::operator+=().
CSG_String CSG_DateTime::Format | ( | const CSG_String & | Format = "" | ) | const |
Definition at line 445 of file datetime.cpp.
References CSG_String::c_str().
CSG_String CSG_DateTime::Format_Date | ( | void | ) | const |
Definition at line 450 of file datetime.cpp.
CSG_String CSG_DateTime::Format_ISOCombined | ( | char | sep = 'T' | ) | const |
Definition at line 470 of file datetime.cpp.
CSG_String CSG_DateTime::Format_ISODate | ( | void | ) | const |
Definition at line 460 of file datetime.cpp.
Referenced by CSG_Parameter_Date::_Set_String().
CSG_String CSG_DateTime::Format_ISOTime | ( | void | ) | const |
Definition at line 465 of file datetime.cpp.
CSG_String CSG_DateTime::Format_Time | ( | void | ) | const |
Definition at line 455 of file datetime.cpp.
CSG_DateTime CSG_DateTime::From_UTC | ( | bool | noDST = false | ) | const |
Definition at line 280 of file datetime.cpp.
References CSG_DateTime().
|
static |
Definition at line 523 of file datetime.cpp.
References Get_Day(), Now(), and Set_To_Current().
|
static |
Definition at line 532 of file datetime.cpp.
|
static |
Definition at line 537 of file datetime.cpp.
unsigned short CSG_DateTime::Get_Day | ( | void | ) | const |
Definition at line 377 of file datetime.cpp.
Referenced by Get_Current_Day(), and CSG_Table_DBase::Set_Value().
unsigned short CSG_DateTime::Get_DayOfYear | ( | void | ) | const |
Definition at line 390 of file datetime.cpp.
Referenced by SG_Get_Day_Length().
|
static |
Definition at line 548 of file datetime.cpp.
|
static |
Definition at line 558 of file datetime.cpp.
unsigned short CSG_DateTime::Get_Hour | ( | void | ) | const |
Definition at line 376 of file datetime.cpp.
double CSG_DateTime::Get_JDN | ( | void | ) | const |
Definition at line 411 of file datetime.cpp.
Referenced by CSG_Parameter_Date::_asDouble(), CSG_Parameters::Add_Date(), and SG_Get_Sun_Position().
unsigned short CSG_DateTime::Get_Millisecond | ( | void | ) | const |
Definition at line 373 of file datetime.cpp.
unsigned short CSG_DateTime::Get_Minute | ( | void | ) | const |
Definition at line 375 of file datetime.cpp.
double CSG_DateTime::Get_MJD | ( | void | ) | const |
Definition at line 416 of file datetime.cpp.
CSG_DateTime::Month CSG_DateTime::Get_Month | ( | void | ) | const |
Definition at line 379 of file datetime.cpp.
Referenced by CSG_Table_DBase::Set_Value().
|
static |
Definition at line 656 of file datetime.cpp.
References _TL, and CSG_String::Printf().
|
static |
Definition at line 543 of file datetime.cpp.
|
static |
Definition at line 564 of file datetime.cpp.
|
static |
Definition at line 569 of file datetime.cpp.
unsigned short CSG_DateTime::Get_Second | ( | void | ) | const |
Definition at line 374 of file datetime.cpp.
sLong CSG_DateTime::Get_Value | ( | void | ) | const |
Definition at line 313 of file datetime.cpp.
Referenced by operator<(), operator<=(), operator==(), operator>(), and operator>=().
CSG_DateTime::WeekDay CSG_DateTime::Get_WeekDay | ( | void | ) | const |
Definition at line 395 of file datetime.cpp.
|
static |
Definition at line 553 of file datetime.cpp.
CSG_DateTime::TSG_DateTime CSG_DateTime::Get_WeekOfMonth | ( | void | ) | const |
Definition at line 400 of file datetime.cpp.
CSG_DateTime::TSG_DateTime CSG_DateTime::Get_WeekOfYear | ( | void | ) | const |
Definition at line 405 of file datetime.cpp.
int CSG_DateTime::Get_Year | ( | void | ) | const |
Definition at line 384 of file datetime.cpp.
Referenced by CSG_Table_DBase::Set_Value().
bool CSG_DateTime::is_Between | ( | const CSG_DateTime & | t1, |
const CSG_DateTime & | t2 | ||
) | const |
Definition at line 436 of file datetime.cpp.
bool CSG_DateTime::is_DST | ( | void | ) | const |
Definition at line 302 of file datetime.cpp.
bool CSG_DateTime::is_EarlierThan | ( | const CSG_DateTime & | DateTime | ) | const |
Definition at line 427 of file datetime.cpp.
bool CSG_DateTime::is_EqualTo | ( | const CSG_DateTime & | DateTime | ) | const |
Definition at line 428 of file datetime.cpp.
Referenced by CSG_Parameter_Date::_Set_Value().
bool CSG_DateTime::is_LaterThan | ( | const CSG_DateTime & | DateTime | ) | const |
Definition at line 429 of file datetime.cpp.
|
static |
Definition at line 575 of file datetime.cpp.
bool CSG_DateTime::is_SameDate | ( | const CSG_DateTime & | DateTime | ) | const |
Definition at line 432 of file datetime.cpp.
bool CSG_DateTime::is_SameTime | ( | const CSG_DateTime & | DateTime | ) | const |
Definition at line 433 of file datetime.cpp.
bool CSG_DateTime::is_StrictlyBetween | ( | const CSG_DateTime & | t1, |
const CSG_DateTime & | t2 | ||
) | const |
Definition at line 437 of file datetime.cpp.
bool CSG_DateTime::is_Valid | ( | void | ) | const |
Definition at line 367 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Make_UTC | ( | bool | noDST = false | ) |
Definition at line 294 of file datetime.cpp.
|
static |
Definition at line 581 of file datetime.cpp.
Referenced by CSG_Parameters::Add_Date(), CSG_Parameter_Date::CSG_Parameter_Date(), CSG_Tool::Execute(), CSG_Tool_Interactive_Base::Execute_Finish(), CSG_Tool_Interactive_Base::Execute_Keyboard(), CSG_Tool_Interactive_Base::Execute_Position(), and Get_Current_Day().
|
inline |
Definition at line 316 of file datetime.h.
|
inline |
Definition at line 313 of file datetime.h.
|
inline |
Definition at line 319 of file datetime.h.
|
inline |
Definition at line 317 of file datetime.h.
|
inline |
Definition at line 314 of file datetime.h.
|
inline |
Definition at line 321 of file datetime.h.
References Get_Value().
|
inline |
Definition at line 322 of file datetime.h.
References Get_Value().
|
inline |
Definition at line 310 of file datetime.h.
|
inline |
Definition at line 311 of file datetime.h.
|
inline |
Definition at line 323 of file datetime.h.
References Get_Value().
|
inline |
Definition at line 325 of file datetime.h.
References Get_Value().
|
inline |
Definition at line 324 of file datetime.h.
References Get_Value().
bool CSG_DateTime::Parse_Date | ( | const CSG_String & | date | ) |
Definition at line 476 of file datetime.cpp.
References CSG_String::c_str().
Referenced by CSG_Parameter_Date::_Set_Value().
bool CSG_DateTime::Parse_DateTime | ( | const CSG_String & | datetime | ) |
Definition at line 481 of file datetime.cpp.
References CSG_String::c_str().
bool CSG_DateTime::Parse_Format | ( | const CSG_String & | date | ) |
Definition at line 496 of file datetime.cpp.
References CSG_String::c_str().
bool CSG_DateTime::Parse_Format | ( | const CSG_String & | date, |
const CSG_String & | format | ||
) |
Definition at line 491 of file datetime.cpp.
References CSG_String::c_str().
bool CSG_DateTime::Parse_Format | ( | const CSG_String & | date, |
const CSG_String & | format, | ||
const CSG_DateTime & | dateDef | ||
) |
Definition at line 486 of file datetime.cpp.
References CSG_String::c_str().
bool CSG_DateTime::Parse_ISOCombined | ( | const CSG_String & | date, |
char | sep = 'T' |
||
) |
Definition at line 502 of file datetime.cpp.
References CSG_String::c_str().
bool CSG_DateTime::Parse_ISODate | ( | const CSG_String & | date | ) |
Definition at line 507 of file datetime.cpp.
References CSG_String::c_str().
Referenced by CSG_Parameter_Date::_Set_Value().
bool CSG_DateTime::Parse_ISOTime | ( | const CSG_String & | date | ) |
Definition at line 512 of file datetime.cpp.
References CSG_String::c_str().
CSG_DateTime & CSG_DateTime::Reset_Time | ( | void | ) |
Definition at line 267 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Set | ( | const CSG_DateTime & | DateTime | ) |
Definition at line 131 of file datetime.cpp.
Referenced by CSG_Parameter_Date::_Set_Value(), CSG_DateTime(), Set(), Set_Hours_AD(), and Set_Unix_Time().
CSG_DateTime & CSG_DateTime::Set | ( | const CSG_String & | ISODate | ) |
Definition at line 147 of file datetime.cpp.
References CSG_String::asInt(), CSG_String::Left(), CSG_String::Length(), CSG_String::Mid(), CSG_String::Right(), and Set().
CSG_DateTime & CSG_DateTime::Set | ( | double | JDN | ) |
Definition at line 139 of file datetime.cpp.
CSG_DateTime & 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 |
||
) |
Definition at line 173 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Set | ( | TSG_DateTime | Hour, |
TSG_DateTime | Minute = 0 , |
||
TSG_DateTime | Second = 0 , |
||
TSG_DateTime | Millisec = 0 |
||
) |
Definition at line 165 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Set_Day | ( | unsigned short | Value | ) |
Definition at line 227 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Set_DayOfYear | ( | unsigned short | Value | ) |
Definition at line 251 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Set_Hour | ( | double | Value | ) |
Definition at line 212 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Set_Hour | ( | unsigned short | Value | ) |
Definition at line 205 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Set_Hours_AD | ( | int | Hours | ) |
Definition at line 611 of file datetime.cpp.
References Set().
CSG_DateTime & CSG_DateTime::Set_Millisecond | ( | unsigned short | Value | ) |
Definition at line 181 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Set_Minute | ( | unsigned short | Value | ) |
Definition at line 197 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Set_Month | ( | unsigned short | Value | ) |
Definition at line 235 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Set_Second | ( | unsigned short | Value | ) |
Definition at line 189 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Set_To_Current | ( | void | ) |
Definition at line 259 of file datetime.cpp.
Referenced by Get_Current_Day().
CSG_DateTime & CSG_DateTime::Set_Unix_Time | ( | sLong | Seconds | ) |
Definition at line 594 of file datetime.cpp.
References Set().
CSG_DateTime & CSG_DateTime::Set_Year | ( | int | Value | ) |
Definition at line 243 of file datetime.cpp.
CSG_TimeSpan CSG_DateTime::Subtract | ( | const CSG_DateTime & | DateTime | ) | const |
Definition at line 354 of file datetime.cpp.
CSG_DateTime & CSG_DateTime::Subtract | ( | const CSG_TimeSpan & | TimeSpan | ) |
Definition at line 346 of file datetime.cpp.
CSG_DateTime CSG_DateTime::Subtract | ( | const CSG_TimeSpan & | TimeSpan | ) | const |
Definition at line 339 of file datetime.cpp.
References Subtract().
Referenced by CSG_TimeSpan::operator-=(), and Subtract().
CSG_DateTime CSG_DateTime::To_UTC | ( | bool | noDST = false | ) | const |
Definition at line 288 of file datetime.cpp.
References CSG_DateTime().