3 #define UTIL_LCTIME_H 1
55 int unixTime()
const {
return ( _t / 1000000000LL ) ; }
66 bool isLeapYear(
int year )
const {
return ( ( !( year % 4 ) && ( year%100 ) ) || !(year%400) ) ; }
84 int year()
const {
return _d.year ; }
87 int month()
const {
return _d.month ; }
90 int day()
const {
return _d.day ; }
93 int hour()
const {
return _d.hour ; }
96 int min()
const {
return _d.min ; }
99 int sec()
const {
return _d.sec ; }
102 int ns()
const {
return _d.ns ; }
115 static bool test(
int nDates ) ;
124 void convertToCalTime() ;
126 void convertFromCalTime() ;
int year() const
Calendar time: year.
Definition: LCTime.h:84
int sec() const
Calendar time: sec.
Definition: LCTime.h:99
int daysInMonth(int month, int year) const
The number if days in the given month and year in the Gregorian calendar.
Definition: LCTime.cc:202
int daysInYear(int year) const
The number if days in the given year in the Gregorian calendar.
Definition: LCTime.cc:196
int unixTime() const
Unix time ( s since 1.1.1970 00:00:00 ).
Definition: LCTime.h:55
long long long64
64 bit signed integer,e.g.to be used for timestamps
Definition: LCIOTypes.h:14
Helper class that allows to convert time stamps as defined in LCEvent::getTimeStamp() ( ns since 1...
Definition: LCTime.h:19
int month() const
Calendar time: month.
Definition: LCTime.h:87
int ns() const
Calendar time: ns.
Definition: LCTime.h:102
std::string getDateString() const
Date in human readable format, e.g.
Definition: LCTime.cc:220
EVENT::long64 timeStamp() const
64bit time stamp as used in LCEvent::getTimestamp().
Definition: LCTime.h:59
int day() const
Calendar time: day.
Definition: LCTime.h:90
int hour() const
Calendar time: hour.
Definition: LCTime.h:93
int min() const
Calendar time: min.
Definition: LCTime.h:96
const CalendarTime & calendarTime() const
Calendar time: year,month,day hour,min,sec and ns.
Definition: LCTime.h:81
void operator+=(EVENT::long64 t)
Add the specified number of ns to the time.
Definition: LCTime.cc:213
static bool test(int nDates)
Tests the LCTime class with nDates random dates Returns true if successful - throws Exception in case...
Definition: LCTime.cc:244
LCTime()
Init with current time ( accuracy depends on OS/machine,etc.) in UTC/GMT.
Definition: LCTime.cc:30
bool isLeapYear(int year) const
True if the year is a leap year in the Gregorian calendar: year is multiple of 4 and not multiple of...
Definition: LCTime.h:66
Helper struct that holds the calendar time.
Definition: LCTime.h:24