SAGA API  v9.5
datetime.cpp File Reference
#include <time.h>
#include <wx/datetime.h>
#include "datetime.h"
#include "mat_tools.h"

Go to the source code of this file.

Functions

bool SG_JulianDayNumber_To_Date (double JDN, int &y, int &m, int &d)
 
CSG_String SG_JulianDayNumber_To_Date (double JDN)
 
CSG_String SG_JulianDayNumber_To_Date (int JDN)
 
double SG_Date_To_JulianDayNumber (int y, int m, int d)
 
double SG_Date_To_JulianDayNumber (const CSG_String &Date)
 
int SG_Get_Day_MidOfMonth (int Month, bool bLeapYear)
 
bool SG_Get_Sun_Position (double JulianDayNumber, double &RA, double &Dec)
 
bool SG_Get_Sun_Position (const CSG_DateTime &Time, double &RA, double &Dec)
 
bool SG_Get_Sun_Position (double JulianDayNumber, double Longitude, double Latitude, double &Height, double &Azimuth)
 
bool SG_Get_Sun_Position (const CSG_DateTime &Time, double Longitude, double Latitude, double &Height, double &Azimuth)
 
double SG_Get_Day_Length (int DayOfYear, double Latitude)
 
double SG_Get_Day_Length (const CSG_DateTime &Date, double Latitude)
 

Function Documentation

◆ SG_Date_To_JulianDayNumber() [1/2]

double SG_Date_To_JulianDayNumber ( const CSG_String Date)

◆ SG_Date_To_JulianDayNumber() [2/2]

double SG_Date_To_JulianDayNumber ( int  y,
int  m,
int  d 
)

Returns the Julian Day Number calculated from Gregorian date (year, month, day).

Definition at line 729 of file datetime.cpp.

Referenced by CSG_Table_Value_Date::Set_Value(), and SG_Date_To_JulianDayNumber().

◆ SG_Get_Day_Length() [1/2]

double SG_Get_Day_Length ( const CSG_DateTime Date,
double  Latitude 
)

Definition at line 927 of file datetime.cpp.

References CSG_DateTime::Get_DayOfYear(), and SG_Get_Day_Length().

◆ SG_Get_Day_Length() [2/2]

double SG_Get_Day_Length ( int  DayOfYear,
double  Latitude 
)

Definition at line 913 of file datetime.cpp.

References M_DEG_TO_RAD, and M_PI.

Referenced by SG_Get_Day_Length().

◆ SG_Get_Day_MidOfMonth()

int SG_Get_Day_MidOfMonth ( int  Month,
bool  bLeapYear 
)

Returns the day number (starting with zero for the first of January) for the mid of the requested month (January = 0).

Definition at line 784 of file datetime.cpp.

◆ SG_Get_Sun_Position() [1/4]

bool SG_Get_Sun_Position ( const CSG_DateTime Time,
double &  RA,
double &  Dec 
)

Definition at line 862 of file datetime.cpp.

References CSG_DateTime::Get_JDN(), and SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [2/4]

bool SG_Get_Sun_Position ( const CSG_DateTime Time,
double  Longitude,
double  Latitude,
double &  Height,
double &  Azimuth 
)

Definition at line 902 of file datetime.cpp.

References CSG_DateTime::Get_JDN(), and SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [3/4]

bool SG_Get_Sun_Position ( double  JulianDayNumber,
double &  RA,
double &  Dec 
)

Calculates the Sun's position for given date and time as declination and right ascension angles (radians). Solar coordinates according to Jean Meeus: Astronomical Algorithms, accuracy of 0.01 degree

Definition at line 835 of file datetime.cpp.

References M_DEG_TO_RAD.

Referenced by SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [4/4]

bool SG_Get_Sun_Position ( double  JulianDayNumber,
double  Longitude,
double  Latitude,
double &  Height,
double &  Azimuth 
)

Calculates the Sun's position for given date and time and position on Earth as given by longitude and latitude (radians). Height and Azimuth are calculated as radians. Returns true if Sun is above horizon.

Definition at line 875 of file datetime.cpp.

References M_DEG_TO_RAD, and SG_Get_Sun_Position().

◆ SG_JulianDayNumber_To_Date() [1/3]

CSG_String SG_JulianDayNumber_To_Date ( double  JDN)

Calculates Gregorian date from Julian Day Number and returns it as ISO 8601 string (yyyy-mm-dd).

Definition at line 698 of file datetime.cpp.

References CSG_String::Printf(), and SG_JulianDayNumber_To_Date().

◆ SG_JulianDayNumber_To_Date() [2/3]

bool SG_JulianDayNumber_To_Date ( double  JDN,
int &  y,
int &  m,
int &  d 
)

Expects 'Value' to be the Julian Day Number.

Definition at line 678 of file datetime.cpp.

Referenced by CSG_Table_Value_Date::Set_Value(), and SG_JulianDayNumber_To_Date().

◆ SG_JulianDayNumber_To_Date() [3/3]

CSG_String SG_JulianDayNumber_To_Date ( int  JDN)

Calculates Gregorian date from Julian Day Number and returns it as ISO 8601 string (yyyy-mm-dd).

Definition at line 719 of file datetime.cpp.

References SG_JulianDayNumber_To_Date().