#include <DayTime.hpp>
Inheritance diagram for DayTime:


There is a seamless conversion between dates, times, and both, as well as the ability to input and output the stored day-time in formatted strings (printf() and setToString()).
Internally, the representation of day and time uses three quantities, (1) jday, an integer representation of Julian Date, specifically jday = int(JD+0.5) or jday=int(MJD+2400001). [Recall that JD = MJD + 2400000.5 and MJD is an integer when second-of-day==0. N.B. jday is NOT == JD or Julian Date, but DayTime::JD() does return JD.] (2) mSod, the integer part of milliseconds of the day, and (3) mSec, the (double) fractional part of milliseconds of the day.
In addition, the representation includes a tolerance value (see below) and a time frame. The time frame is a simple way of denoting the origin or type of day-time which is stored in the object. See TimeFrame for the list of possible values. The time frame of an object is determined in the call to a constructor (default is timeFrame=Unknown), and carried forward into other objects. It may be read or changed using member functions setAllButTimeFrame(), setTimeFrame(), and getTimeFrame().
The member datum 'double tolerance' is used in DayTime comparisons. It defaults to the value of the static gpstk::DayTime::DAYTIME_TOLERANCE, but this can be modified with the static method setDayTimeTolerance(). Several different default tolerances have been defined and are in the DayTime-Specific Definitions section. The tolerance can also be changed on a per object basis with the setTolerance() member function. All comparisons are done using the tolerance as a range for the comparison. So, for example, operator==() returns true if the times are within 'tolerance' seconds. Once set for each object, the tolerance is appropriately "carried forward" to new objects through the copy operator (DayTime::operator=), the copy constructor, and elsewhere.
The internal representation is manipulated using four fundamental routines, two that convert between 'jday' (the integer representation of JD) and calendar date: year/month/day-of-month, and two that convert between seconds-of-day and hour/minute/second. The range of validity of the jday--calendar routines is approximately 4317 B.C. to 4317 A.D.; these limits are incorporated into constants DayTime::BEGINNING_OF_TIME and DayTime::END_OF_TIME.
* All DayTime objects that lie outside these limits are disallowed. *
This internal representation allows close to the maximum precision possible in the time-of-day. Although, note that the code uses FACTOR=1000 everywhere to compute milliseconds, via e.g. mSec=seconds/FACTOR, and thus FACTOR could be changed to give a different precision. (This has not been tested.)
This representation separates day and time-of-day cleanly. Because day and time are logically separated, it is possible to use DayTime for day only, or for time only. Thus, for example, one could instantiate a DayTime object and only manipulate the date, without reference to time-of-day; or vice-versa. [However in this regard note that the default constructor for DayTime sets the data, not to zero, but to the current (system) time; because there is no year 0, a DayTime object with all zero data is invalid!]
When constructing DayTime objects from GPS time values -- such as GPS week and seconds of weeks, or GPS week and z count -- there may be ambiguity associated with the GPS week. Many receivers and receiver processing software store the GPS week as it appears in the NAV message, as a 10 bit number. This leads to a 1024 week ambiguity when 10 bit GPS weeks are used to specify a DayTime. In general, DayTime uses the system time to disambiguate which 1024 week period to use. This is a good assumption except when processing binary data from before GPS week rollover, which occured on August 22, 1999.
Definition at line 154 of file DayTime.hpp.
Public Types | |
| enum | TimeFrame { Unknown, UTC, LocalSystem, GPS_Tx, GPS_Rx, GPS_SV, GPS_Receiver } |
| The various time frames. More... | |
Public Member Functions | |
| DayTime & | setTolerance (const double tol) throw () |
| Sets the tolerance for output and comparisons on this object only. | |
| double | getTolerance () throw () |
| Return the tolerance value currently in use by this object. | |
| DayTime () throw (DayTimeException) | |
| Default constructor. | |
| DayTime (short GPSWeek, double GPSSecond, TimeFrame f=Unknown) throw (DayTimeException) | |
| GPS time with full week constructor. | |
| DayTime (short GPSWeek, double GPSSecond, short year, TimeFrame f=Unknown) throw (DayTimeException) | |
| GPS time constructor. | |
| DayTime (short GPSWeek, long zcount, short year, TimeFrame f=Unknown) throw (DayTimeException) | |
| GPS time constructor. | |
| DayTime (unsigned long fullZcount, TimeFrame f=Unknown) throw (DayTimeException) | |
| GPS time constructor given the full Z count. | |
| DayTime (const GPSZcount &z, TimeFrame f=Unknown) throw (DayTimeException) | |
| GPS Zcount constructor. | |
| DayTime (const CommonTime &c, TimeFrame f=Unknown) throw (DayTimeException) | |
| CommonTime constructor. | |
| DayTime (short year, short month, short day, short hour, short minute, double second, TimeFrame f=Unknown) throw (DayTimeException) | |
| Calendar time constructor. | |
| DayTime (long double MJD, TimeFrame f=Unknown) throw (DayTimeException) | |
| Modified Julian date time constructor. | |
| DayTime (double MJD, TimeFrame f=Unknown) throw (DayTimeException) | |
| Modified Julian date time constructor. | |
| DayTime (short year, short doy, double sod, TimeFrame f=Unknown) throw (DayTimeException) | |
| Day of year time constructor. | |
| DayTime (const struct timeval &t, TimeFrame f=Unknown) throw (DayTimeException) | |
| UNIX time constructor. | |
| ~DayTime () throw () | |
| Destructor. | |
| DayTime (const DayTime &right) throw (DayTimeException) | |
| Copy constructor. | |
| DayTime & | operator= (const DayTime &right) throw () |
| Assignment operator. | |
| double | operator- (const DayTime &right) const throw () |
| DayTime difference function. | |
| DayTime | operator+ (double sec) const throw () |
| Add seconds to this time. | |
| DayTime | operator- (double sec) const throw () |
| Subtract seconds from this time. | |
| DayTime & | operator+= (double sec) throw (DayTimeException) |
| Add seconds to this time. | |
| DayTime & | operator-= (double sec) throw (DayTimeException) |
| Subtract seconds from this time. | |
| DayTime & | addSeconds (double seconds) throw (DayTimeException) |
| Add (double) seconds to this time. | |
| DayTime & | addSeconds (long seconds) throw (DayTimeException) |
| Add (integer) seconds to this time. | |
| DayTime & | addMilliSeconds (long msec) throw (DayTimeException) |
| Add (integer) milliseconds to this time. | |
| DayTime & | addMicroSeconds (long usec) throw (DayTimeException) |
| Add (integer) microseconds to this time. | |
| bool | operator== (const DayTime &right) const throw () |
| Equality operator. | |
| bool | operator!= (const DayTime &right) const throw () |
| Inequality operator. | |
| bool | operator< (const DayTime &right) const throw () |
| Comparison operator (less-than). | |
| bool | operator> (const DayTime &right) const throw () |
| Comparison operator (greater-than). | |
| bool | operator<= (const DayTime &right) const throw () |
| Comparison operator (less-than or equal-to). | |
| bool | operator>= (const DayTime &right) const throw () |
| Comparison operator (greater-than or equal-to). | |
| DayTime & | setAllButTimeFrame (const DayTime &right) throw (DayTimeException) |
| Change time frames via pseudo-copy method. | |
| DayTime & | setTimeFrame (TimeFrame f) throw () |
| Set the time frame for this time. | |
| TimeFrame | getTimeFrame () const throw () |
| Get the time frame for this time. | |
| double | JD () const throw () |
| Get Julian Date JD. | |
| double | MJD () const throw () |
| Get Modified Julian Date MJD. | |
| short | year () const throw () |
| Get year. | |
| short | month () const throw () |
| Get month of year. | |
| short | day () const throw () |
| Get day of month. | |
| short | dayOfWeek () const throw () |
| Get day of week. | |
| void | getYMD (int &yy, int &mm, int &dd) const throw () |
| Get year, month and day of month. | |
| short | hour () const throw () |
| Get hour of day. | |
| short | minute () const throw () |
| Get minutes of hour. | |
| double | second () const throw () |
| Get seconds of minute. | |
| double | secOfDay () const throw () |
| Get seconds of day. | |
| short | GPS10bitweek () const throw () |
| Get 10-bit GPS week. | |
| long | GPSzcount () const throw () |
| Get normal (19 bit) zcount. | |
| long | GPSzcountFloor () const throw () |
| Same as GPSzcount() but without rounding to nearest zcount. | |
| double | GPSsecond () const throw () |
| Get seconds of week. | |
| double | GPSsow () const throw () |
| Get GPS second of week. | |
| short | GPSday () const throw () |
| Get day of week. | |
| short | GPSfullweek () const throw () |
| Get full (>10 bits) week. | |
| short | GPSyear () const throw () |
| Get year. | |
| short | DOYyear () const throw () |
| Get year. | |
| short | DOYday () const throw () |
| Get day of year. | |
| short | DOY () const throw () |
| Get day of year. | |
| double | DOYsecond () const throw () |
| Get seconds of day. | |
| double | MJDdate () const throw () |
| Get object time as a modified Julian date. | |
| long double | getMJDasLongDouble () const throw () |
| Get object time as a (long double) modified Julian date. | |
| timeval | unixTime () const throw (DayTimeException) |
| Get object time in UNIX timeval structure. | |
| unsigned long | fullZcount () const throw () |
| Get time as 32 bit Z count. | |
| unsigned long | fullZcountFloor () const throw () |
| Same as fullZcount() but without rounding to nearest zcount. | |
| operator GPSZcount () const throw (DayTimeException) | |
| Convert this object to a GPSZcount object. | |
| operator CommonTime () const throw (DayTimeException) | |
| Convert this object to a CommonTime object. | |
| DayTime & | setYMDHMS (short year, short month, short day, short hour, short min, double sec, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using calendar (Y/M/D) date and ordinary (H:M:S) time. | |
| DayTime & | setGPS (short week, double sow, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using GPS time. | |
| DayTime & | setGPS (short week, long zcount, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using GPS time (week and Z count). | |
| DayTime & | setGPS (short week, long zcount, short year, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using GPS time. | |
| DayTime & | setGPS (short week, double sow, short year, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using GPS time. | |
| DayTime & | setGPS (unsigned long Zcount, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using GPS time (full Z count). | |
| DayTime & | setGPSfullweek (short fullweek, double sow, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using GPS time. | |
| DayTime & | setGPSfullweek (short fullweek, long zcount, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using GPS time. | |
| DayTime & | setGPSZcount (const GPSZcount &z, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using the given GPSZcount. | |
| DayTime & | setCommonTime (const CommonTime &c, TimeFrame f=Unknown) throw () |
| Set the object's time using the give CommonTime. | |
| DayTime & | setYDoySod (short year, short day_of_year, double sec_of_day, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using day of year. | |
| DayTime & | setMJD (long double mjd, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using (long double) Modified Julian date. | |
| DayTime & | setMJDdate (long double mjd, TimeFrame f=Unknown) throw (DayTimeException) |
| Same as setMJD. | |
| DayTime & | setMJD (double mjd, TimeFrame f=Unknown) throw (DayTimeException) |
| Same as setMJD but with input of type double. | |
| DayTime & | setMJDdate (double mjd, TimeFrame f=Unknown) throw (DayTimeException) |
| Same as setMJD but with input of type double. | |
| DayTime & | setUnix (const struct timeval &t, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using POSIX structures. | |
| DayTime & | setANSI (const time_t &t, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object's time using ANSI structures. | |
| DayTime & | setSystemTime () throw (DayTimeException) |
| Set the object's time to the current system time. | |
| DayTime & | setLocalTime () throw (DayTimeException) |
| Set the object time to the current local time. | |
| DayTime & | setYMD (int yy, int mm, int dd, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object using calendar (Y/M/D) date only (time is unchanged). | |
| DayTime & | setHMS (int hh, int mm, double sec, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object using ordinary (H:M:S) time only (day is unchanged). | |
| DayTime & | setSecOfDay (double sod, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object using seconds of day only (day is unchanged). | |
| DayTime & | setYDoy (int yy, int doy, TimeFrame f=Unknown) throw (DayTimeException) |
| Set the object using year and day of year only (time is unchanged). | |
| DayTime & | setToString (const std::string &str, const std::string &fmt) throw (DayTimeException, FormatException, gpstk::StringUtils::StringException) |
| Similar to scanf, this function takes a string and a format describing string in order to read in daytime values. | |
| std::string | printf (const char *fmt) const throw (gpstk::StringUtils::StringException) |
| Format this time into a string. | |
| std::string | printf (const std::string &fmt) const throw (gpstk::StringUtils::StringException) |
| Format this time into a string. printf(const char*). | |
| std::string | toString (int decimals=0, char datesep='-', char timesep=':') const throw (gpstk::StringUtils::StringException) |
| Returns the string formated as '2005-01-01 12:00:00'. | |
| std::string | asString () const throw (gpstk::StringUtils::StringException) |
| Returns the string that operator<<() would print. | |
| void | dump (std::ostream &s) const throw (DayTimeException) |
| Dump everything possible, using every get() TD: keep? | |
| void | update () |
| Updates the Timestamp with the current time. | |
| double | elapsed () const |
| Returns the time elapsed since the time. | |
| bool | isElapsed (double interval) const |
| Returns true if the given interval has passed since the time. | |
Static Public Member Functions | |
| double | setDayTimeTolerance (const double tol) throw () |
| Changes the DAYTIME_TOLERANCE for all DayTime objects. | |
| double | getDayTimeTolerance () throw () |
| Returns the current DAYTIME_TOLERANCE. | |
| void | convertJDtoCalendar (long jd, int &iyear, int &imonth, int &iday) throw () |
| Fundamental routine to convert from "Julian day" (= JD + 0.5) to calendar day. | |
| long | convertCalendarToJD (int iyear, int imonth, int iday) throw () |
| Fundamental routine to convert from calendar day to "Julian day" (= JD + 0.5). | |
| void | convertSODtoTime (double sod, int &hh, int &mm, double &sec) throw () |
| Fundamental routine to convert seconds of day to H:M:S. | |
| double | convertTimeToSOD (int hh, int mm, double sec) throw () |
| Fundamental routine to convert H:M:S to seconds of day. | |
Static Public Attributes | |
DayTime-Specific Definitions | |
All of these tolerances are 1/2 of the tolerance they specify.
So one nsec tolerance is actually 1/2 an ns added to the time in units of days. | |
| const long | FACTOR = 1000 |
| time-of-day is stored as long (seconds-of-day)*FACTOR plus double (remaining seconds)/FACTOR | |
| const double | JD_TO_MJD = 2400000.5 |
| Conversion offset, Julian Date to Modified Julian Date. | |
| const long | MJD_JDAY = 2400001L |
| 'Julian day' offset from MJD | |
| const long | GPS_EPOCH_JDAY = 2444245L |
| 'Julian day' of GPS epoch (Jan. 1, 1980). | |
| const long | GPS_EPOCH_MJD = 44244L |
| Modified Julian Date of GPS epoch (Jan. 1, 1980). | |
| const long | UNIX_MJD = 40587L |
| Modified Julian Date of UNIX epoch (Jan. 1, 1970). | |
| const long | HALFWEEK = 302400 |
| Seconds per half a GPS week. | |
| const long | FULLWEEK = 604800 |
| Seconds per whole GPS week. | |
| const long | SEC_DAY = 86400 |
| Seconds per day. | |
| const long | MS_PER_DAY = SEC_DAY*1000 |
| Milliseconds in a day. | |
| const double | ONE_NSEC_TOLERANCE = 1e-9 |
| One nanosecond tolerance. | |
| const double | ONE_USEC_TOLERANCE = 1e-6 |
| One microsecond tolerance. | |
| const double | ONE_MSEC_TOLERANCE = 1e-3 |
| One millisecond tolerance. | |
| const double | ONE_SEC_TOLERANCE = 1 |
| One second tolerance. | |
| const double | ONE_MIN_TOLERANCE = 60 |
| One minute tolerance. | |
| const double | ONE_HOUR_TOLERANCE = 3600 |
| One hour tolerance. | |
| double | DAYTIME_TOLERANCE = ONE_NSEC_TOLERANCE |
| Default tolerance for time equality in days. | |
| const long | BEGIN_LIMIT_JDAY = 0 |
| 'julian day' of earliest epoch expressible by DayTime: 1/1/4713 B.C. | |
| const long | END_LIMIT_JDAY = 3442448 |
| 'julian day' of latest epoch expressible by DayTime: 1/1/4713 A.D. | |
| const DayTime | BEGINNING_OF_TIME |
| earliest representable DayTime | |
| const DayTime | END_OF_TIME |
| latest representable DayTime | |
| bool | DAYTIME_TEST_VALID = true |
| If true, check the validity of inputs. | |
|
|
The various time frames.
Definition at line 181 of file DayTime.hpp. |
|
|
Default constructor. Initializes to current system time. Definition at line 167 of file DayTime.cpp. References DayTime::setSystemTime(). |
|
||||||||||||||||
|
GPS time with full week constructor.
Definition at line 178 of file DayTime.cpp. |
|
||||||||||||||||||||
|
GPS time constructor. In the case of 10-bit week input, the year and week are used to deduce the number of GPS week rollovers and thus the full GPS week.
Definition at line 192 of file DayTime.cpp. |
|
||||||||||||||||||||
|
GPS time constructor. In the case of 10-bit week input, the year and week are used to deduce the number of GPS week rollovers and thus the full GPS week.
Definition at line 207 of file DayTime.cpp. |
|
||||||||||||
|
GPS time constructor given the full Z count. The number of GPS week rollovers, and therefore the full GPS week, is determined from the current system time.
Definition at line 221 of file DayTime.cpp. |
|
||||||||||||
|
GPS Zcount constructor. The number of GPS week rollovers, and therefore the full GPS week, is determined from the current system time. Definition at line 232 of file DayTime.cpp. |
|
||||||||||||
|
CommonTime constructor.
Definition at line 243 of file DayTime.cpp. |
|
||||||||||||||||||||||||||||||||
|
Calendar time constructor. This assumes the dates are being specified in Gregorian calender so the days October 5-14 1582 don't exist. Constructing a DayTime with these days will cause an exception to be thrown. See http://www.usno.navy.mil/USNO/astronomical-applications/data-services/jul-date for a reference that this implimentation matches.
Definition at line 259 of file DayTime.cpp. References gpstk::min(). |
|
||||||||||||
|
Modified Julian date time constructor. For some compilers, this result may have diminished accuracy.
Definition at line 275 of file DayTime.cpp. |
|
||||||||||||
|
Modified Julian date time constructor. For some compilers, this result may have diminished accuracy.
Definition at line 286 of file DayTime.cpp. |
|
||||||||||||||||||||
|
Day of year time constructor.
Definition at line 299 of file DayTime.cpp. |
|
||||||||||||
|
UNIX time constructor.
Definition at line 312 of file DayTime.cpp. |
|
|
Destructor.
Definition at line 434 of file DayTime.hpp. |
|
|
Copy constructor.
Definition at line 324 of file DayTime.cpp. |
|
|
Add (integer) microseconds to this time.
Definition at line 428 of file DayTime.cpp. |
|
|
Add (integer) milliseconds to this time.
Definition at line 415 of file DayTime.cpp. |
|
|
Add (integer) seconds to this time.
Definition at line 402 of file DayTime.cpp. |
|
|
Add (double) seconds to this time.
Definition at line 393 of file DayTime.cpp. Referenced by DayTime::operator+(), DayTime::operator-(), and testmeth(). |
|
|
Returns the string that operator<<() would print.
Definition at line 1627 of file DayTime.cpp. Referenced by ConfData::save(). |
|
||||||||||||||||
|
Fundamental routine to convert from calendar day to "Julian day" (= JD + 0.5).
Definition at line 1745 of file DayTime.cpp. Referenced by DayTime::DOY(). |
|
||||||||||||||||||||
|
Fundamental routine to convert from "Julian day" (= JD + 0.5) to calendar day.
Definition at line 1696 of file DayTime.cpp. Referenced by DayTime::day(), DayTime::DOY(), DayTime::month(), and DayTime::year(). |
|
||||||||||||||||||||
|
Fundamental routine to convert seconds of day to H:M:S.
Definition at line 1791 of file DayTime.cpp. Referenced by DayTime::hour(), DayTime::minute(), and DayTime::second(). |
|
||||||||||||||||
|
Fundamental routine to convert H:M:S to seconds of day.
Definition at line 1817 of file DayTime.cpp. |
|
|
Get day of month.
Definition at line 533 of file DayTime.cpp. References DayTime::convertJDtoCalendar(). Referenced by ConfDataItem::format(), LogChannel::getLogText(), DayTime::setToString(), and testRandomAccessors(). |
|
|
Get day of week.
Definition at line 542 of file DayTime.cpp. Referenced by EOPPrediction::getSerialNumber(). |
|
|
Get day of year.
Definition at line 614 of file DayTime.cpp. References DayTime::convertCalendarToJD(), and DayTime::convertJDtoCalendar(). Referenced by RTFileFrame::getRecord(), NeillTropModel::setAllParameters(), MOPSTropModel::setAllParameters(), NeillTropModel::setDayOfYear(), MOPSTropModel::setDayOfYear(), DayTime::setToString(), and testRandomAccessors(). |
|
|
Get day of year.
Definition at line 660 of file DayTime.hpp. Referenced by UTCTime::asGPST(), UTCTime::asTAI(), UTCTime::asUT1(), UTCTime::asUTC(), Msise00Drag::computeDensity(), FICData::generateUniqueKey(), and ObsRngDev::ObsRngDev(). |
|
|
Get seconds of day.
Definition at line 669 of file DayTime.hpp. Referenced by UTCTime::asGPST(), UTCTime::asTAI(), UTCTime::asUT1(), UTCTime::asUTC(), Msise00Drag::computeDensity(), DayTime::setToString(), and testRandomAccessors(). |
|
|
Get year.
Definition at line 655 of file DayTime.hpp. Referenced by FICData::generateUniqueKey(). |
|
|
Dump everything possible, using every get() TD: keep?
Definition at line 1636 of file DayTime.cpp. Referenced by GPSEphemerisStore::dump(), gpstk::operator<<(), and MinSfTest::process(). |
|
|
Returns the time elapsed since the time.
Definition at line 1125 of file DayTime.hpp. Referenced by Application::toltalMilliseconds(). |
|
|
Get time as 32 bit Z count. The 13 MSBs are week modulo 1024, 19 LSBs are seconds of week in Zcounts. Definition at line 655 of file DayTime.cpp. References DayTime::GPS10bitweek(), and DayTime::GPSzcount(). |
|
|
Same as fullZcount() but without rounding to nearest zcount.
Definition at line 662 of file DayTime.cpp. References DayTime::GPS10bitweek(), and DayTime::GPSzcountFloor(). |
|
|
Returns the current DAYTIME_TOLERANCE.
Definition at line 265 of file DayTime.hpp. |
|
|
Get object time as a (long double) modified Julian date. For some compilers, this result may have diminished accuracy. Definition at line 623 of file DayTime.cpp. References DayTime::SEC_DAY, and DayTime::secOfDay(). |
|
|
Get the time frame for this time.
Definition at line 563 of file DayTime.hpp. References gpstk::convertJDtoCalendar(). |
|
|
Return the tolerance value currently in use by this object.
Definition at line 282 of file DayTime.hpp. |
|
||||||||||||||||
|
Get year, month and day of month.
Definition at line 598 of file DayTime.hpp. |
|
|
Get 10-bit GPS week.
Definition at line 579 of file DayTime.cpp. References DayTime::GPSfullweek(). Referenced by DayTime::fullZcount(), and DayTime::fullZcountFloor(). |
|
|
Get day of week.
Definition at line 641 of file DayTime.hpp. Referenced by FICData::generateUniqueKey(), and DayTime::GPSsow(). |
|
|
Get full (>10 bits) week.
Definition at line 607 of file DayTime.cpp. References DayTime::GPS_EPOCH_JDAY. Referenced by MDPSelftestStatus::encode(), MDPPVTSolution::encode(), MDPHeader::encode(), FICData9::FICData9(), FICData::generateUniqueKey(), EOPPrediction::getSerialNumber(), DayTime::GPS10bitweek(), gpstk::makeEngAlmanac(), gpstk::makeEngEphemeris(), gpstk::makeMDPObsEpoch(), DayTime::operator GPSZcount(), NovatelData::operator RinexNavData(), NovatelData::operator RinexObsData(), MinSfTest::process(), DayTime::setGPS(), and testRandomAccessors(). |
|
|
Get seconds of week.
Definition at line 632 of file DayTime.hpp. Referenced by EngEphemeris::dump(), MDPSelftestStatus::encode(), MDPPVTSolution::encode(), MDPHeader::encode(), gpstk::makeMDPObsEpoch(), and MinSfTest::process(). |
|
|
Get GPS second of week.
Definition at line 600 of file DayTime.cpp. References DayTime::GPSday(), DayTime::SEC_DAY, and DayTime::secOfDay(). Referenced by DayTime::GPSzcount(), DayTime::GPSzcountFloor(), DayTime::setToString(), and testRandomAccessors(). |
|
|
Get year.
Definition at line 650 of file DayTime.hpp. |
|
|
Get normal (19 bit) zcount.
Definition at line 586 of file DayTime.cpp. References DayTime::GPSsow(). Referenced by DayTime::fullZcount(), SVPCodeGen::getCurrentSixSeconds(), DayTime::operator GPSZcount(), testMutators(), and testRandomAccessors(). |
|
|
Same as GPSzcount() but without rounding to nearest zcount.
Definition at line 593 of file DayTime.cpp. References DayTime::GPSsow(). Referenced by DayTime::fullZcountFloor(). |
|
|
Get hour of day.
Definition at line 549 of file DayTime.cpp. References DayTime::convertSODtoTime(), and DayTime::secOfDay(). Referenced by ConfDataItem::format(), LogChannel::getLogText(), DayTime::setToString(), and testRandomAccessors(). |
|
|
Returns true if the given interval has passed since the time.
Definition at line 1128 of file DayTime.hpp. |
|
|
Get Julian Date JD.
Definition at line 502 of file DayTime.cpp. References DayTime::SEC_DAY, and DayTime::secOfDay(). Referenced by DayTime::MJD(). |
|
|
Get minutes of hour.
Definition at line 559 of file DayTime.cpp. References DayTime::convertSODtoTime(), and DayTime::secOfDay(). Referenced by ConfDataItem::format(), LogChannel::getLogText(), DayTime::setToString(), and testRandomAccessors(). |
|
|
Get Modified Julian Date MJD.
Definition at line 508 of file DayTime.cpp. References DayTime::JD(). Referenced by UTCTime::asTDB(), EOPPrediction::computeEOP(), SphericalHarmonicGravity::correctCSTides(), ReferenceFrames::doodsonArguments(), ReferenceFrames::earthRotationAngle(), EOPStore::getEOP(), gpstk::GPST2UTC(), ReferenceFrames::iauEqeq94(), ReferenceFrames::iauGmst00(), ReferenceFrames::iauGmst82(), ReferenceFrames::iauPmat76(), ReferenceFrames::meanObliquity(), ReferenceFrames::nutationAngles(), gpstk::TAI2UTC(), SunForce::test(), testMutators(), testRandomAccessors(), gpstk::TT2UTC(), gpstk::UT12UTC(), and SolarSystem::WGS84Position(). |
|
|
Get object time as a modified Julian date.
Definition at line 676 of file DayTime.hpp. |
|
|
Get month of year.
Definition at line 524 of file DayTime.cpp. References DayTime::convertJDtoCalendar(). Referenced by ConfDataItem::format(), LogChannel::getLogText(), DayTime::setToString(), and testRandomAccessors(). |
|
|
Convert this object to a CommonTime object.
Definition at line 690 of file DayTime.cpp. References DayTime::FACTOR, and GPSTK_THROW. |
|
|
Convert this object to a GPSZcount object.
Definition at line 668 of file DayTime.cpp. References DayTime::GPSfullweek(), GPSTK_THROW, and DayTime::GPSzcount(). |
|
|
Inequality operator.
Definition at line 453 of file DayTime.cpp. References gpstk::operator==(). |
|
|
Add seconds to this time.
Definition at line 358 of file DayTime.cpp. References DayTime::addSeconds(). |
|
|
Add seconds to this time.
Definition at line 375 of file DayTime.cpp. |
|
|
Subtract seconds from this time.
Definition at line 367 of file DayTime.cpp. References DayTime::addSeconds(). |
|
|
DayTime difference function.
Definition at line 348 of file DayTime.cpp. |
|
|
Subtract seconds from this time.
Definition at line 384 of file DayTime.cpp. |
|
|
Comparison operator (less-than).
Definition at line 459 of file DayTime.cpp. References gpstk::operator-(). |
|
|
Comparison operator (less-than or equal-to).
Definition at line 473 of file DayTime.cpp. References gpstk::operator>(). |
|
|
Assignment operator.
Definition at line 332 of file DayTime.cpp. References DayTime::jday, DayTime::mSec, DayTime::mSod, DayTime::timeFrame, and DayTime::tolerance. |
|
|
Equality operator.
Definition at line 445 of file DayTime.cpp. References ABS. |
|
|
Comparison operator (greater-than).
Definition at line 466 of file DayTime.cpp. References gpstk::operator-(). |
|
|
Comparison operator (greater-than or equal-to).
Definition at line 479 of file DayTime.cpp. References gpstk::operator<(). |
|
|
Format this time into a string. printf(const char*).
Definition at line 1104 of file DayTime.hpp. |
|
|
|
Get seconds of day.
Definition at line 615 of file DayTime.hpp. Referenced by EOPPrediction::computeEOP(), DayTime::getMJDasLongDouble(), DayTime::GPSsow(), DayTime::hour(), DayTime::JD(), DayTime::minute(), and DayTime::second(). |
|
|
Get seconds of minute.
Definition at line 569 of file DayTime.cpp. References DayTime::convertSODtoTime(), and DayTime::secOfDay(). Referenced by GPSEphemerisStore::addEphemeris(), LinearClockModel::addEpoch(), GPSEphemerisStore::addToList(), RinexObsData::dump(), RinexMetData::dump(), LinearClockModel::dump(), GPSEphemerisStore::dump(), EOPStore::dump(), GPSEphemerisStore::edit(), GPSAlmanacStore::findAlmanac(), GPSAlmanacStore::findMostRecentAlmanac(), GPSEphemerisStore::findNearEphemeris(), GPSEphemerisStore::findUserEphemeris(), ConfDataItem::format(), EpochDataStore::getData(), LogChannel::getLogText(), TabularEphemerisStore::getXvt(), gpstk::makeEngAlmanac(), gpstk::makeEngEphemeris(), gpstk::makeObsEpoch(), gpstk::makeRinexObsData(), DayTime::setToString(), testRandomAccessors(), and GPSEphemerisStore::ubeSize(). |
|
|
Change time frames via pseudo-copy method.
Copies all of
Definition at line 487 of file DayTime.cpp. |
|
||||||||||||
|
Set the object's time using ANSI structures. This uses the ANSI C/C++ time_t struct to set the time. This structure represents the time with a resolution of seconds.
Definition at line 993 of file DayTime.cpp. Referenced by DayTime::setSystemTime(). |
|
||||||||||||
|
Set the object's time using the give CommonTime.
Definition at line 923 of file DayTime.cpp. |
|
|
Changes the DAYTIME_TOLERANCE for all DayTime objects.
Definition at line 260 of file DayTime.hpp. Referenced by main(). |
|
||||||||||||
|
Set the object's time using GPS time (full Z count). The number of GPS week rollovers, and therefore the full GPS week, is determined from the current system time.
Definition at line 857 of file DayTime.cpp. References GPSTK_THROW. |
|
||||||||||||||||||||
|
Set the object's time using GPS time. In case of 10-bit week input, the year and week are used to deduce the number of GPS week rollovers and thus the full GPS week; prefer setGPSfullweek().
Definition at line 787 of file DayTime.cpp. References DayTime::GPSfullweek(), GPSTK_THROW, and DayTime::setYMD(). |
|
||||||||||||||||||||
|
Set the object's time using GPS time. In case of 10-bit week input, the year and week are used to deduce the number of GPS week rollovers and thus the full GPS week; prefer setGPSfullweek().
Definition at line 770 of file DayTime.cpp. |
|
||||||||||||||||
|
Set the object's time using GPS time (week and Z count). In the case of 10-bit week input, the number of GPS week rollovers, and therefore the full GPS week, is determined from the current system time; prefer setGPSfullweek().
Definition at line 756 of file DayTime.cpp. |
|
||||||||||||||||
|
Set the object's time using GPS time. In the case of 10-bit week input, the number of GPS week rollovers, and therefore the full GPS week, is determined from the current system time.
Definition at line 736 of file DayTime.cpp. References DayTime::GPSfullweek(), and DayTime::setSystemTime(). Referenced by gpstk::makeMDPObsEpoch(), gpstk::makeMDPPVTSolution(), DayTime::setToString(), and testMutators(). |
|
||||||||||||||||
|
Set the object's time using GPS time.
Definition at line 833 of file DayTime.hpp. |
|
||||||||||||||||
|
Set the object's time using GPS time.
Definition at line 882 of file DayTime.cpp. References gpstk::StringUtils::asString(), gpstk::FULLWEEK, gpstk::GPS_EPOCH_JDAY, and GPSTK_THROW. Referenced by MDPHeader::decode(), FICData::generateUniqueKey(), EngEphemeris::getEphemerisEpoch(), EngEphemeris::getEpochTime(), EOPPrediction::getSerialNumber(), AlmOrbit::getToaTime(), FICData::getTransmitTime(), EngEphemeris::getTransmitTime(), AlmOrbit::getTransmitTime(), and DayTime::setToString(). |
|
||||||||||||
|
Set the object's time using the given GPSZcount. The number of GPS week rollovers, and therefore the full GPS week, is determined from the current system time.
Definition at line 911 of file DayTime.cpp. |
|
||||||||||||||||||||
|
Set the object using ordinary (H:M:S) time only (day is unchanged).
Definition at line 1070 of file DayTime.cpp. References ABS, gpstk::StringUtils::asString(), gpstk::convertSODtoTime(), gpstk::convertTimeToSOD(), and GPSTK_THROW. Referenced by testMutators(). |
|
|
Set the object time to the current local time.
Definition at line 1027 of file DayTime.cpp. References DayTime::setYMDHMS(). Referenced by Logger::log(), RinexNavHeader::reallyPutRecord(), RinexMetHeader::reallyPutRecord(), RinexGloNavHeader::reallyPutRecord(), and RinexObsHeader::WriteHeaderRecords(). |
|
||||||||||||
|
Same as setMJD but with input of type double.
Definition at line 893 of file DayTime.hpp. |
|
||||||||||||
|
Set the object's time using (long double) Modified Julian date. This just sets the time to the indicated modified Julian date.
Definition at line 955 of file DayTime.cpp. References GPSTK_THROW, and gpstk::MJD_JDAY. Referenced by EOPPrediction::computeEOP(), EOPStore::dump(), SolarSystem::endTime(), PlanetEphemeris::endTime(), EarthOceanTide::getOceanTide(), EOPPrediction::getSerialNumber(), SolarSystem::readASCIIdata(), PlanetEphemeris::readASCIIdata(), DayTime::setToString(), SolarSystem::startTime(), PlanetEphemeris::startTime(), HarrisPriesterDrag::test(), testMutators(), and testRandomAccessors(). |
|
||||||||||||
|
Same as setMJD but with input of type double.
Definition at line 899 of file DayTime.hpp. |
|
||||||||||||
|
Same as setMJD.
Definition at line 887 of file DayTime.hpp. |
|
||||||||||||
|
Set the object using seconds of day only (day is unchanged).
Definition at line 1095 of file DayTime.cpp. References GPSTK_THROW. Referenced by testMutators(). |
|
|
Set the object's time to the current system time. If the POSIX gettimeofday() system call is available, it is used to determine system time. If the gettimeofday() call is not available, the ANSI time() system call is used to determine system time.
Definition at line 1004 of file DayTime.cpp. References DayTime::LocalSystem, DayTime::setANSI(), and DayTime::setUnix(). Referenced by DayTime::DayTime(), main(), and DayTime::setGPS(). |
|
|
Set the time frame for this time.
Definition at line 558 of file DayTime.hpp. |
|
|
Sets the tolerance for output and comparisons on this object only. See the constants in this file (e.g. ONE_NSEC_TOLERANCE) for some easy to use tolerance values.
Definition at line 157 of file DayTime.cpp. Referenced by main(). |
|
||||||||||||
|
Similar to scanf, this function takes a string and a format describing string in order to read in daytime values. The parameters it can take are listed below and described above with the printf() function. The specification must resolve to a day at a minimum level. The following table lists combinations that give valid times. Anything more or other combinations will give unknown (read as: "bad") results so don't try it. Anything less will throw an exception. If nothing changes the time of day, it will default to midnight. Also, the year defaults to the current year if a year isn't specified or can't be determined.
1 of... and 1 of.... optional... %C %G %w %g %Z %Y %y %F %w %g %Z %m %B %b %a %A %d %Y %y %H %M %S %Q %j %Y %y %s So time.setToString("Aug 1, 2000 20:20:20", "%b %d, %Y %H:%M:%S") time.setToString("Aug 2000", "%b %Y") Don't worry about counting whitespace - this function will take care of that. Just make sure that the extra stuff in the format string (ie '.' ',') are in the same relative location as they are in the actual string. (see in the example above))
Definition at line 1140 of file DayTime.cpp. References Exception::addText(), gpstk::StringUtils::asDouble(), gpstk::StringUtils::asInt(), DayTime::day(), DayTime::DOY(), DayTime::DOYsecond(), gpstk::StringUtils::firstWord(), DayTime::GPSsow(), GPSTK_THROW, DayTime::hour(), gpstk::StringUtils::isLike(), gpstk::StringUtils::lowerCase(), DayTime::minute(), DayTime::month(), DayTime::second(), DayTime::setGPS(), DayTime::setGPSfullweek(), DayTime::setMJD(), DayTime::setUnix(), DayTime::setYDoySod(), DayTime::setYMDHMS(), gpstk::StringUtils::stripLeading(), DayTime::unixTime(), and DayTime::year(). Referenced by SVExclusionList::addFile(), CommandOptionWithTimeArg::checkArguments(), FileSpec::extractDayTime(), and main(). |
|
||||||||||||
|
Set the object's time using POSIX structures. This uses the POSIX timeval struct to set the time. This structure represents the time with a resolution of microseconds.
Definition at line 980 of file DayTime.cpp. References gpstk::MJD_JDAY, and gpstk::UNIX_MJD. Referenced by DayTime::setSystemTime(), and DayTime::setToString(). |
|
||||||||||||||||
|
Set the object using year and day of year only (time is unchanged).
Definition at line 1116 of file DayTime.cpp. References gpstk::convertCalendarToJD(), gpstk::convertJDtoCalendar(), and GPSTK_THROW. Referenced by testMutators(). |
|
||||||||||||||||||||
|
Set the object's time using day of year.
Definition at line 940 of file DayTime.cpp. Referenced by RTFileFrame::getRecord(), DayTime::setToString(), and gpstk::UT12UTC(). |
|
||||||||||||||||||||
|
Set the object using calendar (Y/M/D) date only (time is unchanged).
Definition at line 1043 of file DayTime.cpp. References gpstk::convertCalendarToJD(), gpstk::convertJDtoCalendar(), and GPSTK_THROW. Referenced by DayTime::setGPS(), and testMutators(). |
|
||||||||||||||||||||||||||||||||
|
Set the object's time using calendar (Y/M/D) date and ordinary (H:M:S) time.
Definition at line 717 of file DayTime.cpp. References gpstk::min(). Referenced by EOPPrediction::getSerialNumber(), SatOrbitStore::loadGNV1BFile(), ProblemSatFilter::loadSatelliteProblemFile(), ConfDataItem::parse(), DayTime::setLocalTime(), DayTime::setToString(), and testMutators(). |
|
||||||||||||||||
|
Returns the string formated as '2005-01-01 12:00:00'.
Definition at line 1611 of file DayTime.cpp. |
|
|
Get object time in UNIX timeval structure.
Definition at line 632 of file DayTime.cpp. References gpstk::MJD_JDAY, and gpstk::UNIX_MJD. Referenced by DayTime::setToString(). |
|
|
Updates the Timestamp with the current time.
Definition at line 1122 of file DayTime.hpp. Referenced by Application::main(). |
|
|
Get year.
Definition at line 515 of file DayTime.cpp. References DayTime::convertJDtoCalendar(). Referenced by ConfDataItem::format(), LogChannel::getLogText(), RTFileFrame::getRecord(), EOPPrediction::getSerialNumber(), gpstk::parseTime(), DayTime::setToString(), and testRandomAccessors(). |
|
|
'julian day' of earliest epoch expressible by DayTime: 1/1/4713 B.C.
Definition at line 140 of file DayTime.cpp. |
|
|
Initial value:
DayTime(DayTime::BEGIN_LIMIT_JDAY, 0, 0.0, DayTime::DAYTIME_TOLERANCE)
Definition at line 145 of file DayTime.cpp. |
|
|
If true, check the validity of inputs. Throw DayTimeException on failure. Definition at line 153 of file DayTime.cpp. |
|
|
Default tolerance for time equality in days.
Definition at line 136 of file DayTime.cpp. |
|
|
'julian day' of latest epoch expressible by DayTime: 1/1/4713 A.D.
Definition at line 143 of file DayTime.cpp. |
|
|
Initial value:
DayTime(DayTime::END_LIMIT_JDAY, 0, 0.0, DayTime::DAYTIME_TOLERANCE)
Definition at line 148 of file DayTime.cpp. |
|
|
time-of-day is stored as long (seconds-of-day)*FACTOR plus double (remaining seconds)/FACTOR
Definition at line 97 of file DayTime.cpp. Referenced by DayTime::operator CommonTime(). |
|
|
Seconds per whole GPS week.
Definition at line 102 of file DayTime.cpp. |
|
|
'Julian day' of GPS epoch (Jan. 1, 1980).
Definition at line 113 of file DayTime.cpp. Referenced by DayTime::GPSfullweek(). |
|
|
Modified Julian Date of GPS epoch (Jan. 1, 1980).
Definition at line 115 of file DayTime.cpp. |
|
|
Seconds per half a GPS week.
Definition at line 100 of file DayTime.cpp. |
|
|
Conversion offset, Julian Date to Modified Julian Date.
Definition at line 109 of file DayTime.cpp. |
|
|
'Julian day' offset from MJD
Definition at line 111 of file DayTime.cpp. |
|
|
Milliseconds in a day.
Definition at line 106 of file DayTime.cpp. |
|
|
One hour tolerance.
Definition at line 130 of file DayTime.cpp. |
|
|
One minute tolerance.
Definition at line 128 of file DayTime.cpp. |
|
|
One millisecond tolerance.
Definition at line 124 of file DayTime.cpp. |
|
|
One nanosecond tolerance.
Definition at line 120 of file DayTime.cpp. |
|
|
One second tolerance.
Definition at line 126 of file DayTime.cpp. |
|
|
One microsecond tolerance.
Definition at line 122 of file DayTime.cpp. |
|
|
Seconds per day.
Definition at line 104 of file DayTime.cpp. Referenced by DayTime::getMJDasLongDouble(), DayTime::GPSsow(), and DayTime::JD(). |
|
|
Modified Julian Date of UNIX epoch (Jan. 1, 1970).
Definition at line 117 of file DayTime.cpp. |
1.3.9.1