Isis Developer Reference
Isis::iTime Class Reference

Parse and return pieces of a time string. More...

#include <iTime.h>

Collaboration diagram for Isis::iTime:
Collaboration graph

Public Member Functions

 iTime ()
 Constructs an empty iTime object.
 
 iTime (const QString &time)
 Constructs a iTime object and initializes it to the time from the argument.
 
 iTime (const double time)
 Constructs a iTime object and initializes it to the time from the argument.
 
 ~iTime ()
 
void operator= (const QString &time)
 Changes the value of the iTime object.
 
void operator= (const char *time)
 
void operator= (const double time)
 
bool operator>= (const iTime &time)
 Compare two iTime objects for greater than or equal.
 
bool operator<= (const iTime &time)
 Compare two iTime objects for less than or equal.
 
bool operator> (const iTime &time)
 Compare two iTime objects for greater than.
 
bool operator< (const iTime &time)
 Compare two iTime objects for less than.
 
bool operator!= (const iTime &time)
 Compare two iTime objects for inequality.
 
bool operator== (const iTime &time)
 Compare two iTime objects for equality.
 
iTime operator+ (const double &secondsToAdd) const
 
void operator+= (const double &secondsToAdd)
 
iTime operator- (const double &secondsToSubtract) const
 
double operator- (const iTime &iTimeToSubtract) const
 
void operator-= (const double &secondsToSubtract)
 
QString YearString () const
 Returns the year portion of the time as a string.
 
int Year () const
 Returns the year portion of the time as an int.
 
QString MonthString () const
 Returns the month portion of the time as a string.
 
int Month () const
 Returns the month portion of the time as an int.
 
QString DayString () const
 Returns the dat portion of the time as a string.
 
int Day () const
 Returns the day portion of the time as an int.
 
QString HourString () const
 Returns the hour portion of the time as a string.
 
int Hour () const
 Returns the hour portion of the time as an int.
 
QString MinuteString () const
 Returns the minute portion of the time as a string.
 
int Minute () const
 Returns the minute portion of the time as an int.
 
QString SecondString (int precision=8) const
 Returns the second portion of the time as a string.
 
double Second () const
 Returns the second portion of the time as a double.
 
QString DayOfYearString () const
 Returns the day of year portion of the time as a string.
 
int DayOfYear () const
 Returns the day of year portion of the time as an int.
 
QString EtString () const
 Returns the ephemeris time (TDB) representation of the time as a string.
 
double Et () const
 Returns the ephemeris time (TDB) representation of the time as a double.
 
QString UTC (int precision=8) const
 Returns the internally stored time, formatted as a UTC time.
 
void setEt (double et)
 
void setUtc (QString utcString)
 

Static Public Member Functions

static QString CurrentGMT ()
 Returns the current Greenwich Mean iTime The time is based on the system time, so it is only as accurate as the local system clock.
 
static QString CurrentLocalTime ()
 Returns the current local time This time is taken directly from the system clock, so if the system clock is off, this will be, too.
 

Friends

iTime operator+ (const double &secondsToAdd, iTime time)
 
iTime operator- (const double &secondsToSubtract, iTime time)
 

Detailed Description

Parse and return pieces of a time string.

This class parses a date/time string into individual components. The input time string can be in a variety of formats (see the NAIF routine str2et_c). The components and different representation can then be returned using the member functions.

Author
2003-10-24 Stuart Sides

Constructor & Destructor Documentation

◆ iTime() [1/3]

Isis::iTime::iTime ( )

Constructs an empty iTime object.

◆ iTime() [2/3]

Isis::iTime::iTime ( const QString & time)

Constructs a iTime object and initializes it to the time from the argument.

Parameters
timeA time string formatted in standard UTC or similar format. Example:"2000/12/31 23:59:01.6789" or "2000-12-31T23:59:01.6789"

References Isis::NaifStatus::CheckErrors().

◆ iTime() [3/3]

Isis::iTime::iTime ( const double time)
inline

Constructs a iTime object and initializes it to the time from the argument.

Parameters
timeAn ephemeris time (ET).

◆ ~iTime()

Isis::iTime::~iTime ( )
inline

Member Function Documentation

◆ CurrentGMT()

QString Isis::iTime::CurrentGMT ( )
static

Returns the current Greenwich Mean iTime The time is based on the system time, so it is only as accurate as the local system clock.

Returns
QString The Current GMT

◆ CurrentLocalTime()

QString Isis::iTime::CurrentLocalTime ( )
static

Returns the current local time This time is taken directly from the system clock, so if the system clock is off, this will be, too.

Returns
QString The cutrrent local time

Referenced by Isis::JigsawRunWidget::bundleFinished(), and Isis::BundleSolutionInfo::outputHeader().

◆ Day()

int Isis::iTime::Day ( ) const

Returns the day portion of the time as an int.

Returns
int

References Isis::NaifStatus::CheckErrors(), and Isis::IString::ToInteger().

Referenced by DayString(), and UTC().

◆ DayOfYear()

int Isis::iTime::DayOfYear ( ) const

Returns the day of year portion of the time as an int.

Returns
int

References Isis::NaifStatus::CheckErrors(), and Isis::IString::ToInteger().

Referenced by DayOfYearString().

◆ DayOfYearString()

QString Isis::iTime::DayOfYearString ( ) const

Returns the day of year portion of the time as a string.

Returns
string

References DayOfYear(), and Isis::toString().

◆ DayString()

QString Isis::iTime::DayString ( ) const

Returns the dat portion of the time as a string.

Returns
string

References Day(), and Isis::toString().

Referenced by UTC().

◆ Et()

◆ EtString()

QString Isis::iTime::EtString ( ) const

Returns the ephemeris time (TDB) representation of the time as a string.

See the Naif documentation "time.req" for more information.

Returns
string

References Isis::toString().

◆ Hour()

int Isis::iTime::Hour ( ) const

Returns the hour portion of the time as an int.

Returns
int

References Isis::NaifStatus::CheckErrors(), and Isis::IString::ToInteger().

Referenced by HourString(), and UTC().

◆ HourString()

QString Isis::iTime::HourString ( ) const

Returns the hour portion of the time as a string.

Returns
string

References Hour(), and Isis::toString().

Referenced by UTC().

◆ Minute()

int Isis::iTime::Minute ( ) const

Returns the minute portion of the time as an int.

Returns
int

References Isis::NaifStatus::CheckErrors(), and Isis::IString::ToInteger().

Referenced by MinuteString(), and UTC().

◆ MinuteString()

QString Isis::iTime::MinuteString ( ) const

Returns the minute portion of the time as a string.

Returns
string

References Minute(), and Isis::toString().

Referenced by UTC().

◆ Month()

int Isis::iTime::Month ( ) const

Returns the month portion of the time as an int.

Returns
int

References Isis::NaifStatus::CheckErrors(), and Isis::IString::ToInteger().

Referenced by MonthString(), and UTC().

◆ MonthString()

QString Isis::iTime::MonthString ( ) const

Returns the month portion of the time as a string.

Returns
string

References Month(), and Isis::toString().

Referenced by UTC().

◆ operator!=()

bool Isis::iTime::operator!= ( const iTime & time)

Compare two iTime objects for inequality.

Parameters
timeThe iTime object to be compared to "this"
Returns
bool

◆ operator+()

iTime Isis::iTime::operator+ ( const double & secondsToAdd) const

◆ operator+=()

void Isis::iTime::operator+= ( const double & secondsToAdd)

References Isis::IsSpecial().

◆ operator-() [1/2]

iTime Isis::iTime::operator- ( const double & secondsToSubtract) const

◆ operator-() [2/2]

double Isis::iTime::operator- ( const iTime & iTimeToSubtract) const

◆ operator-=()

void Isis::iTime::operator-= ( const double & secondsToSubtract)

References Isis::IsSpecial().

◆ operator<()

bool Isis::iTime::operator< ( const iTime & time)

Compare two iTime objects for less than.

Parameters
timeThe iTime object to be compared to "this"
Returns
bool

◆ operator<=()

bool Isis::iTime::operator<= ( const iTime & time)

Compare two iTime objects for less than or equal.

Parameters
timeThe iTime object to be compared to "this"
Returns
bool

◆ operator=() [1/3]

void Isis::iTime::operator= ( const char * time)

◆ operator=() [2/3]

void Isis::iTime::operator= ( const double time)

◆ operator=() [3/3]

void Isis::iTime::operator= ( const QString & time)

Changes the value of the iTime object.

Parameters
timeA time string formatted in standard UTC or similar format. Example:"2000/12/31 23:59:01.6789" or "2000-12-31T23:59:01.6789"

References Isis::NaifStatus::CheckErrors().

◆ operator==()

bool Isis::iTime::operator== ( const iTime & time)

Compare two iTime objects for equality.

Parameters
timeThe iTime object to be compared to "this"
Returns
bool

◆ operator>()

bool Isis::iTime::operator> ( const iTime & time)

Compare two iTime objects for greater than.

Parameters
timeThe iTime object to be compared to "this"
Returns
bool

◆ operator>=()

bool Isis::iTime::operator>= ( const iTime & time)

Compare two iTime objects for greater than or equal.

Parameters
timeThe iTime object to be compared to "this"
Returns
bool

◆ Second()

double Isis::iTime::Second ( ) const

Returns the second portion of the time as a double.

Returns
double

References Isis::NaifStatus::CheckErrors(), and Isis::IString::ToDouble().

Referenced by SecondString(), and UTC().

◆ SecondString()

QString Isis::iTime::SecondString ( int precision = 8) const

Returns the second portion of the time as a string.

Returns
string

References Second().

Referenced by UTC().

◆ setEt()

void Isis::iTime::setEt ( double et)

References Isis::IsSpecial().

Referenced by setUtc().

◆ setUtc()

◆ UTC()

QString Isis::iTime::UTC ( int precision = 8) const

Returns the internally stored time, formatted as a UTC time.

Returns
string The internalized time, in UTC format

References Day(), DayString(), Hour(), HourString(), Minute(), MinuteString(), Month(), MonthString(), Second(), SecondString(), and YearString().

◆ Year()

int Isis::iTime::Year ( ) const

Returns the year portion of the time as an int.

Returns
int

References Isis::NaifStatus::CheckErrors(), and Isis::IString::ToInteger().

Referenced by YearString().

◆ YearString()

QString Isis::iTime::YearString ( ) const

Returns the year portion of the time as a string.

Returns
string

References Isis::toString(), and Year().

Referenced by UTC().

Friends And Related Symbol Documentation

◆ operator+

iTime operator+ ( const double & secondsToAdd,
iTime time )
friend

◆ operator-

iTime operator- ( const double & secondsToSubtract,
iTime time )
friend

The documentation for this class was generated from the following files: