Go to the documentation of this file.
11 #ifndef GAUDIKERNEL_TIME_ICPP
12 #define GAUDIKERNEL_TIME_ICPP 1
64 return ( (
year % 4 ) == 0 && ( (
year % 100 ) != 0 || (
year % 400 ) == 0 ) );
TimeSpan & operator-=(const TimeSpan &x)
Subtract from a time span.
Gaudi::Time operator+(const Gaudi::Time &t, const Gaudi::TimeSpan &ts)
Gaudi::TimeSpan operator-(const Gaudi::Time &t1, const Gaudi::Time &t2)
Time & operator+=(const TimeSpan &x)
Add the specified amount to the time.
bool operator<(backwards_compatibility_hack_time_timespan, backwards_compatibility_hack_time_timespan)
int minutes() const
Get the number of complete minutes in the span.
ValueType seconds() const
Get the number of complete seconds in the span.
int year(bool local) const
Get the year.
static const int SECS_PER_DAY
Seconds in 24 hours.
static Time epoch()
Returns the minimum time.
Time()=default
Initialize an empty (zero) time value.
std::string nanoformat(size_t minwidth=1, size_t maxwidth=9) const
Format the nanosecond fractional part of the time as a string.
int lastNSeconds() const
Get the number of nanoseconds in the last incomplete second of the span.
static Time max()
Returns the maximum time.
StreamBuffer & operator<<(StreamBuffer &s, const Gaudi::Time &t)
bool operator!(const Gaudi::Time &t)
ValueType ns() const
Return the time span as nanoseconds.
backwards_compatibility_hack_time_timespan()=delete
static bool isLeap(int year)
Check if the year is a leap-year.
TimeSpan & operator/=(const TimeSpan &n)
Divide a time span.
int lastSeconds() const
Get the number of complete seconds in the last incomplete minute of the span.
TimeSpan()=default
Initialize an empty (zero) time difference.
TimeSpan & operator%=(const TimeSpan &n)
Compute a modulo of a time span.
ValueType ns() const
Return the time as nanoseconds since 00:00:00 on January 1, 1970 in UTC.
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
TimeSpan & operator+=(const TimeSpan &x)
Add to a time span.
TimeSpan & operator*=(const TimeSpan &n)
Multiply a time span.
int days() const
Get the number of complete days in the span.
StreamBuffer & operator>>(StreamBuffer &s, Gaudi::Time &t)
static const ValueType SEC_NSECS
Nanoseconds in one second.
int lastMinutes() const
Get the number of complete minutes in the last incomplete hour of the span.
int hours() const
Get the number of complete hours in the span.
std::ostream & operator<<(std::ostream &o, const Gaudi::StringKey &key)
printout of the object reply on the native printout for the string
void TimeAssert(bool cond, std::string_view msg="time assertion failed") const
static const int SECS_PER_HOUR
Seconds in one hour hour.
int lastHours() const
Get the number of complete hours in the last incomplete day of the span.
Time & operator-=(const TimeSpan &x)
Subtract the specified amount from the time.