kstars
KStarsDateTime Class Reference
Extension of ExtDateTime for KStars Instead of an integer Julian Day, KStarsDateTime uses a long double Julian Day, in which the fractional portion encodes the time of day to a precision of a less than a second. More...
#include <kstarsdatetime.h>

Public Member Functions | |
KStarsDateTime | addDays (int nd) const |
KStarsDateTime | addSecs (long double s) const |
long double | djd () const |
double | epoch () const |
dms | gst () const |
QTime | GSTtoUT (dms GST) const |
long double | JDat0hUT () const |
double | jdFrac () const |
KStarsDateTime (const ExtDate &_d, const QTime &_t) | |
KStarsDateTime (const ExtDateTime &kdt) | |
KStarsDateTime (const KStarsDateTime &kdt) | |
KStarsDateTime (long double djd) | |
KStarsDateTime (double djd) | |
KStarsDateTime (long int jd) | |
KStarsDateTime () | |
bool | operator!= (const KStarsDateTime &d) const |
bool | operator< (const KStarsDateTime &d) const |
bool | operator<= (const KStarsDateTime &d) const |
bool | operator== (const KStarsDateTime &d) const |
bool | operator> (const KStarsDateTime &d) const |
bool | operator>= (const KStarsDateTime &d) const |
void | setDate (const ExtDate &d) |
void | setDJD (long double jd) |
void | setFromEpoch (double e) |
void | setTime (const QTime &t) |
Static Public Member Functions | |
static KStarsDateTime | currentDateTime () |
Detailed Description
Extension of ExtDateTime for KStars Instead of an integer Julian Day, KStarsDateTime uses a long double Julian Day, in which the fractional portion encodes the time of day to a precision of a less than a second.Also adds Greenwich Sidereal Time.
- Note:
- Local time and Local sideral time are not handled here. Because they depend on the geographic location, they are part of the GeoLocation class.
- Version:
- 1.0
Definition at line 43 of file kstarsdatetime.h.
Constructor & Destructor Documentation
KStarsDateTime::KStarsDateTime | ( | ) |
Default constructor Creates a date/time at J2000 (noon on Jan 1, 200).
Definition at line 24 of file kstarsdatetime.cpp.
KStarsDateTime::KStarsDateTime | ( | long int | jd | ) |
Constructor Creates a date/time at the specified Julian Day.
jd
The Julian Day
- Note:
- this is overloaded from ExtDateTime. It does not allow for assigning the time of day, because the jd argument is an integer
Definition at line 28 of file kstarsdatetime.cpp.
KStarsDateTime::KStarsDateTime | ( | double | djd | ) |
Constructor Creates a date/time at the specified Julian Day.
jd
The Julian Day
Definition at line 50 of file kstarsdatetime.cpp.
KStarsDateTime::KStarsDateTime | ( | long double | djd | ) |
Constructor Creates a date/time at the specified Julian Day.
jd
The Julian Day
Definition at line 54 of file kstarsdatetime.cpp.
KStarsDateTime::KStarsDateTime | ( | const KStarsDateTime & | kdt | ) |
Copy constructor kdt
The KStarsDateTime object to copy.
Definition at line 32 of file kstarsdatetime.cpp.
KStarsDateTime::KStarsDateTime | ( | const ExtDateTime & | kdt | ) |
Copy constructor kdt
The ExtDateTime object to copy.
Definition at line 36 of file kstarsdatetime.cpp.
KStarsDateTime::KStarsDateTime | ( | const ExtDate & | _d, | |
const QTime & | _t | |||
) |
Constructor Create a KStarsDateTimne based on the specified Date and Time.
_d
The ExtDate to assign _t
The QTime to assign
Definition at line 44 of file kstarsdatetime.cpp.
Member Function Documentation
KStarsDateTime KStarsDateTime::addDays | ( | int | nd | ) | const [inline] |
Modify the Date/Time by adding a number of days.
nd
the number of days to add. The number can be negative.
Definition at line 124 of file kstarsdatetime.h.
KStarsDateTime KStarsDateTime::addSecs | ( | long double | s | ) | const [inline] |
Modify the Date/Time by adding a number of seconds.
s
the number of seconds to add. The number can be negative.
Definition at line 118 of file kstarsdatetime.h.
KStarsDateTime KStarsDateTime::currentDateTime | ( | ) | [static] |
- Returns:
- the date and time according to the CPU clock (note that this is not necessarily UT)
Definition at line 58 of file kstarsdatetime.cpp.
long double KStarsDateTime::djd | ( | ) | const [inline] |
- Returns:
- the julian day as a long double, including the time as the fractional portion.
Definition at line 142 of file kstarsdatetime.h.
double KStarsDateTime::epoch | ( | ) | const [inline] |
- Returns:
- the epoch value of the Date/Time.
- Note:
- the epoch is shorthand for the date, expressed as a floating-point year value.
- See also:
- setFromEpoch()
Definition at line 178 of file kstarsdatetime.h.
dms KStarsDateTime::gst | ( | ) | const |
- Returns:
- The Greenwich Sidereal Time The Greenwich sidereal time is the Right Ascension coordinate that is currently transiting the Prime Meridian at the Royal Observatory in Greenwich, UK (longitude=0.0)
Definition at line 97 of file kstarsdatetime.cpp.
Convert a given Greenwich Sidereal Time to Universal Time (=Greenwich Mean Time).
GST
the Greenwich Sidereal Time to convert to Universal Time.
Definition at line 135 of file kstarsdatetime.cpp.
long double KStarsDateTime::JDat0hUT | ( | ) | const [inline] |
- Returns:
- the Julian Day value for the current date, but at 0h UT.
- Note:
- the returned value is always an integer value + 0.5.
Definition at line 157 of file kstarsdatetime.h.
double KStarsDateTime::jdFrac | ( | ) | const [inline] |
- Returns:
- the fraction of the Julian Day corresponding to the current time. Because the integer Julian Day value jd() is referenced to Noon on the current date, jdFrac() ranges between values of -0.5 and +0.5 for the previous and next midnights, respectively.
Definition at line 150 of file kstarsdatetime.h.
bool KStarsDateTime::operator!= | ( | const KStarsDateTime & | d | ) | const [inline] |
Definition at line 127 of file kstarsdatetime.h.
bool KStarsDateTime::operator< | ( | const KStarsDateTime & | d | ) | const [inline] |
Definition at line 128 of file kstarsdatetime.h.
bool KStarsDateTime::operator<= | ( | const KStarsDateTime & | d | ) | const [inline] |
Definition at line 129 of file kstarsdatetime.h.
bool KStarsDateTime::operator== | ( | const KStarsDateTime & | d | ) | const [inline] |
Definition at line 126 of file kstarsdatetime.h.
bool KStarsDateTime::operator> | ( | const KStarsDateTime & | d | ) | const [inline] |
Definition at line 130 of file kstarsdatetime.h.
bool KStarsDateTime::operator>= | ( | const KStarsDateTime & | d | ) | const [inline] |
Definition at line 131 of file kstarsdatetime.h.
void KStarsDateTime::setDate | ( | const ExtDate & | d | ) |
Assign the Date according to an ExtDate object.
d
the ExtDate to assign
Definition at line 84 of file kstarsdatetime.cpp.
void KStarsDateTime::setDJD | ( | long double | jd | ) |
Assign the (long double) Julian Day value, which includes the time of day encoded in the fractional portion.
jd
the Julian Day value to assign.
Definition at line 66 of file kstarsdatetime.cpp.
void KStarsDateTime::setFromEpoch | ( | double | e | ) |
Set the Date/Time from an epoch value.
e
the epoch value
- See also:
- epoch()
Definition at line 154 of file kstarsdatetime.cpp.
void KStarsDateTime::setTime | ( | const QTime & | t | ) |
Assign the Time according to a QTime object.
t
the QTime to assign
Definition at line 92 of file kstarsdatetime.cpp.
The documentation for this class was generated from the following files: