Go to the documentation of this file.
48 tv.tv_sec = right.
tv.tv_sec ;
49 tv.tv_usec = right.
tv.tv_usec;
61 (
static_cast<double>(
tv.tv_usec ) * 1e-6 ),
64 catch (InvalidParameter& ip)
66 InvalidRequest ir(ip);
83 if ((
sizeof(
tv.tv_sec) <= 4) && ((ct < MIN_CT) || (ct > MAX_CT)))
85 InvalidRequest ir(
"Unable to convert given CommonTime to UnixTime.");
96 tv.tv_usec =
static_cast<time_t
>( fsod * 1e6 + 0.5 ) ;
98 if (
tv.tv_usec >= 1000000)
100 tv.tv_usec -= 1000000;
110 std::string rv( fmt );
120 catch( gnsstk::StringUtils::StringException&
se )
131 std::string rv( fmt );
141 catch( gnsstk::StringUtils::StringException&
se )
151 for( IdToValue::const_iterator i = info.begin(); i != info.end(); i++ )
156 tv.tv_sec =
asInt( i->second );
160 tv.tv_usec =
asInt( i->second );
189 tv.tv_sec =
tv.tv_usec = 0;
201 if(
tv.tv_sec == right.
tv.tv_sec &&
211 return ( !
operator==( right ) );
221 gnsstk::InvalidRequest ir(
"CommonTime objects not in same time system, cannot be compared");
225 if(
tv.tv_sec < right.
tv.tv_sec )
229 if(
tv.tv_sec == right.
tv.tv_sec &&
230 tv.tv_usec < right.
tv.tv_usec )
239 return ( !
operator<=( right ) );
244 return (
operator<( right ) ||
245 operator==( right ) );
250 return ( !
operator<( right ) );
long asInt(const std::string &s)
double se
obliquity cos, T*cos, sin coefficients
static const GNSSTK_EXPORT double eps
Default tolerance for time equality in days.
const long SEC_PER_DAY
Seconds per day.
virtual std::string printf(const std::string &fmt) const
@ Any
wildcard; allows comparison with any other type
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
virtual CommonTime convertToCommonTime() const
const long MJD_JDAY
'Julian day' offset from MJD
virtual bool operator<=(const UnixTime &right) const
@ Unknown
unknown time frame; for legacy code compatibility
virtual bool operator!=(const UnixTime &right) const
virtual bool setFromInfo(const IdToValue &info)
const long UNIX_MJD
Modified Julian Date of UNIX epoch (Jan. 1, 1970).
TimeSystem asTimeSystem(const std::string &s)
Convert a string representation of TimeSystem to an enum.
virtual bool operator>=(const UnixTime &right) const
virtual bool operator==(const UnixTime &right) const
UnixTime & operator=(const UnixTime &right)
void get(long &day, long &sod, double &fsod, TimeSystem &timeSystem) const
virtual bool operator>(const UnixTime &right) const
#define GNSSTK_RETHROW(exc)
virtual void reset()
Reset this object to the default state.
virtual std::string printError(const std::string &fmt) const
virtual bool isValid() const
Returns true if this object's members are valid, false otherwise.
#define GNSSTK_THROW(exc)
UnixTime(int sec=0, int usec=0, TimeSystem ts=TimeSystem::Unknown)
std::string formattedPrint(const std::string &fmt, const std::string &pat, const std::string &rep, T to)
virtual void convertFromCommonTime(const CommonTime &ct)
virtual bool operator<(const UnixTime &right) const
CommonTime & set(long day, long sod, double fsod=0.0, TimeSystem timeSystem=TimeSystem::Unknown)
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:42