25#ifndef LSST_DAF_BASE_DATETIME_H
26#define LSST_DAF_BASE_DATETIME_H
205 bool operator==(
DateTime const& rhs)
const;
224 static
void initializeLeapSeconds(
std::
string const& leapString);
230 void _assertValid()
const {
243 double _getMjd(Timescale scale)
const;
252 double _getJd(Timescale scale)
const;
262 double _getEpoch(Timescale scale)
const;
271 void setNsecsFromMjd(
double mjd, Timescale scale);
280 void setNsecsFromJd(
double jd, Timescale scale);
289 void setNsecsFromEpoch(
double epoch, Timescale scale);
291 friend class boost::serialization::access;
299 template <
class Archive>
300 void serialize(Archive ar,
int const version) {
#define LSST_EXCEPT(type,...)
Class for handling dates/times, including MJD, UTC, and TAI.
DateTime()
Default constructor: construct an invalid DateTime.
std::string toString(Timescale scale) const
Get date as an ISO8601-formatted string.
bool isValid() const
Is this date valid?
struct timespec timespec(Timescale scale) const
Get date as a timespec struct, with time in seconds and nanoseconds.
double get(DateSystem system=MJD, Timescale scale=TAI) const
Get date as a double in a specified representation, such as MJD.
struct timeval timeval(Timescale scale) const
Get date as a timeval struct, with time in seconds and microseconds.
struct tm gmtime(Timescale scale) const
Get date as a tm struct, with truncated fractional seconds.
static constexpr long long invalid_nsecs
long long nsecs(Timescale scale=TAI) const
Get date as nanoseconds since the unix epoch.
lsst::daf::base::DateTime argument_type
size_t operator()(argument_type const &obj) const noexcept