Go to the documentation of this file.
11 #ifndef GAUDIKERNEL_TIME_H
12 #define GAUDIKERNEL_TIME_H 1
39 typedef struct _FILETIME FILETIME;
74 TimeSpan(
int days,
int hours,
int mins,
int secs,
int nsecs );
81 int lastHours()
const;
82 int lastMinutes()
const;
83 int lastSeconds()
const;
84 int lastNSeconds()
const;
264 static const int SECS_PER_DAY = 86400;
267 static const int SECS_PER_HOUR = 3600;
278 Time(
int year,
int month,
int day,
int hour,
int min,
int sec,
ValueType nsecs,
bool local =
true );
288 static Time current();
290 static Time from(
const FILETIME* systime );
294 tm split(
bool local,
int* nsecpart = 0 )
const;
295 tm utc(
int* nsecpart = 0 )
const;
296 tm local(
int* nsecpart = 0 )
const;
298 int year(
bool local )
const;
299 int month(
bool local )
const;
300 int day(
bool local )
const;
301 int hour(
bool local )
const;
302 int minute(
bool local )
const;
303 int second(
bool local )
const;
305 int weekday(
bool local )
const;
306 bool isdst(
bool local )
const;
308 ValueType utcoffset(
int* daylight = 0 )
const;
309 const char* timezone(
int* daylight = 0 )
const;
317 std::string nanoformat(
size_t minwidth = 1,
size_t maxwidth = 9 )
const;
319 static bool isLeap(
int year );
322 static unsigned toDosDate(
Time time );
323 static Time fromDosDate(
unsigned dosDate );
341 inline void TimeAssert(
bool cond, std::string_view
msg =
"time assertion failed" )
const {
349 #endif // GAUDIKERNEL_TIME_H
friend bool operator>=(const Gaudi::Time &t1, const Gaudi::Time &t2)
friend bool operator<=(const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2)
Time()=default
Initialize an empty (zero) time value.
ValueType ns() const
Return the time span as nanoseconds.
friend Gaudi::TimeSpan operator-(const Gaudi::TimeSpan &ts1, const Gaudi::TimeSpan &ts2)
friend bool operator>(const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2)
friend bool operator==(const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2)
TimeSpan()=default
Initialize an empty (zero) time difference.
friend bool operator==(const Gaudi::Time &t1, const Gaudi::Time &t2)
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
friend bool operator<(const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2)
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
friend bool operator>(const Gaudi::Time &t1, const Gaudi::Time &t2)
Months
Symbolic names for months.
void TimeAssert(bool cond, std::string_view msg="time assertion failed") const
TimeException(std::string Message="unspecified exception", std::string Tag="*Gaudi::Time*", StatusCode Code=StatusCode::FAILURE)
friend bool operator!=(const Gaudi::Time &t1, const Gaudi::Time &t2)
friend Gaudi::TimeSpan operator+(const Gaudi::TimeSpan &ts1, const Gaudi::TimeSpan &ts2)
constexpr static const auto FAILURE
friend bool operator<=(const Gaudi::Time &t1, const Gaudi::Time &t2)
friend bool operator>=(const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2)
friend bool operator!=(const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2)
friend bool operator<(const Gaudi::Time &t1, const Gaudi::Time &t2)