1 #ifndef GAUDIKERNEL_TIME_ICPP 2 #define GAUDIKERNEL_TIME_ICPP 1 61 return ( ( year % 4 ) == 0 && ( ( year % 100 ) != 0 || ( year % 400 ) == 0 ) );
Time()=default
Initialize an empty (zero) time value.
static const int SECS_PER_HOUR
Seconds in one hour hour.
static Time max()
Returns the maximum time.
bool operator!(const Gaudi::Time &t)
TimeSpan & operator/=(const TimeSpan &n)
Divide a time span.
The stream buffer is a small object collecting object data.
void TimeAssert(bool cond, const std::string &msg="time assertion failed") const
TimeSpan & operator*=(const TimeSpan &n)
Multiply a time span.
friend Gaudi::TimeSpan operator+(const Gaudi::TimeSpan &ts1, const Gaudi::TimeSpan &ts2)
TimeSpan()=default
Initialize an empty (zero) time difference.
TimeSpan & operator+=(const TimeSpan &x)
Add to a time span.
int lastNSeconds() const
Get the number of nanoseconds in the last incomplete second of the span.
static const ValueType SEC_NSECS
Nanoseconds in one second.
ValueType ns() const
Return the time span as nanoseconds.
int days() const
Get the number of complete days in the span.
TimeSpan & operator-=(const TimeSpan &x)
Subtract from a time span.
int lastMinutes() const
Get the number of complete minutes in the last incomplete hour of the span.
std::string nanoformat(size_t minwidth=1, size_t maxwidth=9) const
Format the nanosecond fractional part of the time as a string.
TimeSpan & operator%=(const TimeSpan &n)
Compute a modulo of a time span.
Time & operator+=(const TimeSpan &x)
Add the specified amount to the time.
int hours() const
Get the number of complete hours in the span.
static bool isLeap(int year)
Check if the year is a leap-year.
ValueType seconds() const
Get the number of complete seconds in the span.
static const int SECS_PER_DAY
Seconds in 24 hours.
static Time epoch()
Returns the minimum time.
ValueType ns() const
Return the time as nanoseconds since 00:00:00 on January 1, 1970 in UTC.
StreamBuffer & operator>>(StreamBuffer &s, Gaudi::Time &t)
friend Gaudi::TimeSpan operator-(const Gaudi::TimeSpan &ts1, const Gaudi::TimeSpan &ts2)
Time & operator-=(const TimeSpan &x)
Subtract the specified amount from the time.
int year(bool local) const
Get the year.
friend bool operator<(const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2)
Helper functions to set/get the application return code.
int lastHours() const
Get the number of complete hours in the last incomplete day of the span.
int lastSeconds() const
Get the number of complete seconds in the last incomplete minute of the span.
std::ostream & operator<<(std::ostream &o, const Gaudi::StringKey &key)
printout of the object reply on the native printout for the string
int minutes() const
Get the number of complete minutes in the span.