File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis Developer Reference
iTime.h
Go to the documentation of this file.
1 #ifndef Time_h
2 #define Time_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include <string>
11 
12 #include <SpiceUsr.h>
13 #include <SpiceZfc.h>
14 #include <SpiceZmc.h>
15 
16 #include "FileName.h"
17 
18 class QString;
19 
20 namespace Isis {
21 
65  class iTime {
66  public:
67  // constructor
68  iTime();
69  iTime(const QString &time);
70 
76  iTime(const double time) {
77  if(!p_lpInitialized)
78  LoadLeapSecondKernel();
79 
80  p_et = time;
81  }
82 
83  // destructor
84  ~iTime() {};
85 
86  void operator=(const QString &time);
87  void operator=(const char *time);
88  void operator=(const double time);
89 
90  bool operator>=(const iTime &time);
91  bool operator<=(const iTime &time);
92  bool operator>(const iTime &time);
93  bool operator<(const iTime &time);
94  bool operator!=(const iTime &time);
95  bool operator==(const iTime &time);
96 
97  iTime operator +(const double &secondsToAdd) const;
98  void operator +=(const double &secondsToAdd);
99  friend iTime operator +(const double &secondsToAdd, iTime time);
100 
101  iTime operator -(const double &secondsToSubtract) const;
102  double operator -(const iTime &iTimeToSubtract) const;
103  void operator -=(const double &secondsToSubtract);
104  friend iTime operator -(const double &secondsToSubtract, iTime time);
105 
106  // Return the year
107  QString YearString() const;
108  int Year() const;
109  QString MonthString() const;
110  int Month() const;
111  QString DayString() const;
112  int Day() const;
113  QString HourString() const;
114  int Hour() const;
115  QString MinuteString() const;
116  int Minute() const;
117  QString SecondString(int precision=8) const;
118  double Second() const;
119  QString DayOfYearString() const;
120  int DayOfYear() const;
121  QString EtString() const;
122 
126  double Et() const {
127  return p_et;
128  }
129 
130  QString UTC(int precision=8) const;
131  static QString CurrentGMT();
132  static QString CurrentLocalTime();
133 
134  void setEt(double et);
135  void setUtc(QString utcString);
136 
137  private:
138  double p_et;
141  void LoadLeapSecondKernel();
142 
143  static bool p_lpInitialized;
144  };
145 };
146 
147 #endif
Isis::iTime::iTime
iTime()
Constructs an empty iTime object.
Definition: iTime.cpp:32
Isis::IString::ToDouble
double ToDouble() const
Returns the floating point value the IString represents.
Definition: IString.cpp:799
FileName.h
Isis::iTime::operator>
bool operator>(const iTime &time)
Compare two iTime objects for greater than.
Definition: iTime.cpp:127
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::operator-
iTime operator-(const double &secondsToSubtract, iTime time)
Definition: iTime.cpp:205
Isis::iTime::operator!=
bool operator!=(const iTime &time)
Compare two iTime objects for inequality.
Definition: iTime.cpp:150
Isis::iTime
Parse and return pieces of a time string.
Definition: iTime.h:65
Isis::iTime::operator<=
bool operator<=(const iTime &time)
Compare two iTime objects for less than or equal.
Definition: iTime.cpp:116
Isis::iTime::EtString
QString EtString() const
Returns the ephemeris time (TDB) representation of the time as a string.
Definition: iTime.cpp:396
SpecialPixel.h
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::iTime::operator<
bool operator<(const iTime &time)
Compare two iTime objects for less than.
Definition: iTime.cpp:139
NaifStatus.h
Isis::iTime::Minute
int Minute() const
Returns the minute portion of the time as an int.
Definition: iTime.cpp:325
Isis::iTime::CurrentLocalTime
static QString CurrentLocalTime()
Returns the current local time This time is taken directly from the system clock, so if the system cl...
Definition: iTime.cpp:513
Isis::IString::ToInteger
int ToInteger() const
Returns the object string as an integer.
Definition: IString.cpp:718
Isis::iTime::operator==
bool operator==(const iTime &time)
Compare two iTime objects for equality.
Definition: iTime.cpp:161
Preference.h
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::IsSpecial
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
IString.h
Isis::iTime::Month
int Month() const
Returns the month portion of the time as an int.
Definition: iTime.cpp:253
Isis::iTime::SecondString
QString SecondString(int precision=8) const
Returns the second portion of the time as a string.
Definition: iTime.cpp:340
Isis::iTime::Et
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition: iTime.h:126
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::iTime::iTime
iTime(const double time)
Constructs a iTime object and initializes it to the time from the argument.
Definition: iTime.h:76
Isis::iTime::Year
int Year() const
Returns the year portion of the time as an int.
Definition: iTime.cpp:229
Isis::iTime::CurrentGMT
static QString CurrentGMT()
Returns the current Greenwich Mean iTime The time is based on the system time, so it is only as accur...
Definition: iTime.cpp:497
Isis::iTime::MonthString
QString MonthString() const
Returns the month portion of the time as a string.
Definition: iTime.cpp:244
Isis::iTime::MinuteString
QString MinuteString() const
Returns the minute portion of the time as a string.
Definition: iTime.cpp:316
Isis::iTime::DayString
QString DayString() const
Returns the dat portion of the time as a string.
Definition: iTime.cpp:268
Isis::iTime::Hour
int Hour() const
Returns the hour portion of the time as an int.
Definition: iTime.cpp:301
Isis::iTime::Second
double Second() const
Returns the second portion of the time as a double.
Definition: iTime.cpp:356
Isis::iTime::~iTime
~iTime()
Definition: iTime.h:84
Isis::iTime::Day
int Day() const
Returns the day portion of the time as an int.
Definition: iTime.cpp:277
Isis::iTime::DayOfYearString
QString DayOfYearString() const
Returns the day of year portion of the time as a string.
Definition: iTime.cpp:371
std
Namespace for the standard library.
Isis::iTime::HourString
QString HourString() const
Returns the hour portion of the time as a string.
Definition: iTime.cpp:292
Isis::iTime::setUtc
void setUtc(QString utcString)
Definition: iTime.cpp:432
iTime.h
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
Isis::Preference::Preferences
static Preference & Preferences(bool unitTest=false)
Definition: Preference.cpp:86
Isis::operator+
iTime operator+(const double &secondsToAdd, iTime time)
Definition: iTime.cpp:179
Isis::iTime::operator=
void operator=(const QString &time)
Changes the value of the iTime object.
Definition: iTime.cpp:66
Isis::iTime::operator-
iTime operator-(const double &secondsToSubtract) const
Definition: iTime.cpp:187
Isis::iTime::YearString
QString YearString() const
Returns the year portion of the time as a string.
Definition: iTime.cpp:220
Isis::iTime::UTC
QString UTC(int precision=8) const
Returns the internally stored time, formatted as a UTC time.
Definition: iTime.cpp:405
Isis::iTime::operator-=
void operator-=(const double &secondsToSubtract)
Definition: iTime.cpp:199
Isis::iTime::operator>=
bool operator>=(const iTime &time)
Compare two iTime objects for greater than or equal.
Definition: iTime.cpp:105
Isis::iTime::setEt
void setEt(double et)
Definition: iTime.cpp:425
Isis::iTime::operator+=
void operator+=(const double &secondsToAdd)
Definition: iTime.cpp:173
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::iTime::operator+
iTime operator+(const double &secondsToAdd) const
Definition: iTime.cpp:166
Isis::iTime::DayOfYear
int DayOfYear() const
Returns the day of year portion of the time as an int.
Definition: iTime.cpp:380

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 03/21/2022 06:54:57