283 tm
split(
bool local,
int* nsecpart = 0 )
const;
284 tm
utc(
int* nsecpart = 0 )
const;
285 tm
local(
int* nsecpart = 0 )
const;
298 const char*
timezone(
int* daylight = 0 )
const;
305 std::string
format(
bool local, std::string spec =
"%c" )
const;
306 std::string
nanoformat( std::size_t minwidth = 1, std::size_t maxwidth = 9 )
const;
320 inline void TimeAssert(
bool cond, std::string_view msg =
"time assertion failed" )
const {
371 return ( (
year % 4 ) == 0 && ( (
year % 100 ) != 0 || (
year % 400 ) == 0 ) );
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
TemplatedAlg< int, std::vector< std::string > > t1
TemplatedAlg< double, bool > t2
StreamBuffer & operator<<(StreamBuffer &s, const Gaudi::Time &t)
bool operator<(backwards_compatibility_hack_time_timespan, backwards_compatibility_hack_time_timespan)
StreamBuffer & operator>>(StreamBuffer &s, Gaudi::Time &t)
Gaudi::Time operator+(const Gaudi::Time &t, const Gaudi::TimeSpan &ts)
bool operator!(const Gaudi::Time &t)
Gaudi::TimeSpan operator-(const Gaudi::Time &t1, const Gaudi::Time &t2)
Months
Symbolic names for months.
tm local(int *nsecpart=0) const
Break up the time to the standard library representation, converting it first to local time.
int hour(bool local) const
Get the hour, numbered [0, 23].
std::string nanoformat(std::size_t minwidth=1, std::size_t maxwidth=9) const
Format the nanosecond fractional part of the time as a string.
static Time epoch()
Returns the minimum time.
static Time build(bool local, const tm &base, TimeSpan diff=0)
Construct a time from local time base and a delta diff.
int second(bool local) const
Get the seconds, numbered [0,61] (allowing one or two leap seconds, years with leap seconds can have ...
static constexpr int SECS_PER_HOUR
Seconds in one hour hour.
int month(bool local) const
Get the month, numbered [0,11].
const char * timezone(int *daylight=0) const
Return the local timezone name that applies at this time value.
int weekday(bool local) const
Get the day of week, numbered [0,6] and starting from Sunday.
static Time max()
Returns the maximum time.
int nsecond() const
Get the nanoseconds.
static bool isLeap(int year)
Check if the year is a leap-year.
ValueType ns() const
Return the time as nanoseconds since 00:00:00 on January 1, 1970 in UTC.
int minute(bool local) const
Get the minute, numbered [0, 59].
static Time fromDosDate(unsigned dosDate)
Convert the MS-DOS date dosDate into a Time.
Time & operator-=(const TimeSpan &x)
Subtract the specified amount from the time.
friend auto operator<=>(const Gaudi::Time &t1, const Gaudi::Time &t2)=default
bool isdst(bool local) const
Check whether daylight savings is in effect.
Time()=default
Initialize an empty (zero) time value.
int year(bool local) const
Get the year.
static constexpr int SECS_PER_DAY
Seconds in 24 hours.
Time & operator+=(const TimeSpan &x)
Add the specified amount to the time.
tm utc(int *nsecpart=0) const
Break up the time to the standard library representation, keeping it in UTC.
static Time current()
Returns the current time.
int day(bool local) const
Get the day of month, numbered [1,31].
static constexpr ValueType SEC_NSECS
Nanoseconds in one second.
ValueType utcoffset(int *daylight=0) const
Return the number of nanoseconds that needs to be added to UTC to translate this time to the local ti...
tm split(bool local, int *nsecpart=0) const
Break up the time to the standard representation, either in UTC (if local is false) or local time (if...
void TimeAssert(bool cond, std::string_view msg="time assertion failed") const
static unsigned toDosDate(Time time)
Convert the Time t into a MS-DOS date format.
TimeSpan & operator/=(const TimeSpan &n)
Divide a time span.
int lastNSeconds() const
Get the number of nanoseconds in the last incomplete second of the span.
ValueType seconds() const
Get the number of complete seconds in the span.
int lastSeconds() const
Get the number of complete seconds in the last incomplete minute of the span.
ValueType ns() const
Return the time span as nanoseconds.
TimeSpan & operator-=(const TimeSpan &x)
Subtract from a time span.
friend Gaudi::TimeSpan operator-(const Gaudi::TimeSpan &ts1, const Gaudi::TimeSpan &ts2)
TimeSpan & operator+=(const TimeSpan &x)
Add to a time span.
friend Gaudi::TimeSpan operator+(const Gaudi::TimeSpan &ts1, const Gaudi::TimeSpan &ts2)
int days() const
Get the number of complete days in the span.
TimeSpan & operator*=(const TimeSpan &n)
Multiply a time span.
int hours() const
Get the number of complete hours in the span.
TimeSpan & operator%=(const TimeSpan &n)
Compute a modulo of a time span.
TimeSpan()=default
Initialize an empty (zero) time difference.
int minutes() const
Get the number of complete minutes in the span.
int lastMinutes() const
Get the number of complete minutes in the last incomplete hour of the span.
friend auto operator<=>(const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2)=default
int lastHours() const
Get the number of complete hours in the last incomplete day of the span.
GaudiException(std::string Message, std::string Tag, StatusCode Code)
Constructor (1)
constexpr static const auto FAILURE
The stream buffer is a small object collecting object data.
backwards_compatibility_hack_time_timespan()=delete
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
std::ostream & operator<<(std::ostream &o, const Gaudi::StringKey &key)
printout of the object reply on the native printout for the string
Exception thrown by Gaudi::Time.
TimeException(std::string Message="unspecified exception", std::string Tag="*Gaudi::Time*", StatusCode Code=StatusCode::FAILURE)