25 #ifndef LSST_DAF_BASE_DATETIME_H 26 #define LSST_DAF_BASE_DATETIME_H 54 namespace serialization {
114 DateTime(
int year,
int month,
int day,
int hr,
int min,
int sec,
Timescale scale = TAI);
144 long long nsecs(
Timescale scale = TAI)
const;
186 struct timespec timespec(
Timescale scale) const;
196 struct timeval timeval(
Timescale scale) const;
201 bool isValid()
const {
return _nsecs != DateTime::invalid_nsecs; };
203 bool operator==(
DateTime const& rhs)
const;
219 static void initializeLeapSeconds(
std::string const& leapString);
225 void _assertValid()
const {
265 void setNsecsFromMjd(
double mjd,
Timescale scale);
274 void setNsecsFromJd(
double jd,
Timescale scale);
283 void setNsecsFromEpoch(
double epoch,
Timescale scale);
285 friend class boost::serialization::access;
293 template <
class Archive>
294 void serialize(Archive ar,
int const version) {
Class for handling dates/times, including MJD, UTC, and TAI.
#define LSST_EXCEPT(type,...)
bool isValid() const
Is this date valid?