This class implements time calculations.
More...
#include <gTime.hpp>
|
| gTime (double ai_jDays=0) |
|
| gTime (int year, double day) |
|
| gTime (int nYear, int nMonth, int nDay, int nHour, int nMin, double nSec) |
|
| gTime (struct tm ai_timestruct) |
|
| gTime (const gTime &timeSrc) |
|
void | setTime (int year, double day) |
| Set the time value of the time object to the julian day of year, day. More...
|
|
const gTime & | operator= (const gTime &timeSrc) |
| overload de = operator to assign time values to he object. More...
|
|
const gTime & | operator= (time_t t) |
| overload de = operator to assign time values to he object in time_t (operating system) format. More...
|
|
const gTime & | operator= (double t) |
| overload the = operator to assign time values to the object in julian days. More...
|
|
double | getGmtTm () const |
| Returns the time GMT value in Julian days. More...
|
|
double | getLocalTm () const |
| Returns the time Local value in Julian days. More...
|
|
time_t | toTime () const |
| Returns the time_t value of the gTime Object. More...
|
|
void | toCalendarDate (int *pYear, int *pMonth, double *pDom) const |
|
double | toJCenturies () const |
|
double | toThetaGMST () const |
| Calculate Theta Angle at Greenwich Mean Time for the Julian date. More...
|
|
double | toThetaLMST (double longitude) const |
| Calculate Theta Angle at Local Mean Time for the Julian date. More...
|
|
gTimeSpan | operator- (gTime time) const |
|
gTime | operator- (gTimeSpan timeSpan) const |
|
gTime | operator+ (gTimeSpan timeSpan) const |
|
const gTime & | operator+= (gTimeSpan timeSpan) |
|
const gTime & | operator-= (gTimeSpan timeSpan) |
|
bool | operator== (gTime time) const |
|
bool | operator!= (gTime time) const |
|
bool | operator< (gTime time) const |
|
bool | operator> (gTime time) const |
|
bool | operator<= (gTime time) const |
|
bool | operator>= (gTime time) const |
|
This class implements time calculations.
Time is stored in julian days
- Time getting in GMT, Local and Sidereal (earth rotational angle)
- Time Math operations.
Definition at line 143 of file gTime.hpp.
static gTime gTime::getCurrentTime |
( |
| ) |
|
|
static |
Returns a gTime object setted with the actual machine time.
- Warning
- This method works with the operating system function time. So it doesn't support seconds fractions
- Returns
- gTime Object assigned with real machine time.
double gTime::getGmtTm |
( |
| ) |
const |
Returns the time GMT value in Julian days.
- Returns
- : double Julian Days represented in the gTime Object
double gTime::getLocalTm |
( |
| ) |
const |
Returns the time Local value in Julian days.
- Returns
- : double Julian Days represented in the gTime Object
Returns a gTimeSpan object setted with the Local Time Span setted in the machine.
- Returns
- gTimeSpan Object assigned with the real machine GMT Diff.
static bool gTime::isLeapYear |
( |
int |
ai_year | ) |
|
|
inlinestatic |
const gTime& gTime::operator= |
( |
const gTime & |
timeSrc | ) |
|
overload de = operator to assign time values to he object.
- Parameters
-
timeSrc | Time to be assigned |
- Returns
- const gTime& Reference to *this object modified after operation
const gTime& gTime::operator= |
( |
time_t |
t | ) |
|
overload de = operator to assign time values to he object in time_t (operating system) format.
- Parameters
-
- Returns
- const gTime& Reference to *this object modified after operation
const gTime& gTime::operator= |
( |
double |
t | ) |
|
|
inline |
overload the = operator to assign time values to the object in julian days.
- Parameters
-
- Returns
- const gTime& Reference to *this object modified after operation
Definition at line 193 of file gTime.hpp.
void gTime::setTime |
( |
int |
year, |
|
|
double |
day |
|
) |
| |
Set the time value of the time object to the julian day of year, day.
References:
Astronomical Formulae for Calculators.
Jean Meeus
Chapter 3: Julian Day and Calendar Date. PG's 23, 24, 25
- Parameters
-
[in] | year | date year |
[in] | day | date day and day fraction. Notice: 1 Jan is day=0 (not 1) |
double gTime::toThetaGMST |
( |
| ) |
const |
double gTime::toThetaLMST |
( |
double |
longitude | ) |
const |
Calculate Theta Angle at Local Mean Time for the Julian date.
- Parameters
-
[in] | longitude | Geographical longitude for the local meridian.
Positive longitude = east longitude
Negative longitude = west longitude
|
- Returns
- Theta Angle in radians, measuring eastward from the Vernal Equinox to the prime meridian
time_t gTime::toTime |
( |
| ) |
const |
Returns the time_t value of the gTime Object.
- Warning
- time_t object doesn't support seconds fractions. This method must be avoid for astronomical calculation.
- Returns
- : time_t machine time represented in the gTime Object
The documentation for this class was generated from the following file:
- /home/aw/devel/stellarium/0.15/plugins/Satellites/src/gsatellite/gTime.hpp