3 #define UTIL_LCTIME_H 1
66 bool isLeapYear(
int y )
const {
return ( ( !( y % 4 ) && ( y%100 ) ) || !(y%400) ) ; }
115 static bool test(
int nDates ) ;
128 static const int dpm[13] ;
int year() const
Calendar time: year.
int sec() const
Calendar time: sec.
int unixTime() const
Unix time ( s since 1.1.1970 00:00:00 ).
int daysInMonth(int m, int y) const
The number if days in the given month and year in the Gregorian calendar.
long long long64
64 bit signed integer,e.g.to be used for timestamps
Helper class that allows to convert time stamps as defined in LCEvent::getTimeStamp() ( ns since 1...
int month() const
Calendar time: month.
int ns() const
Calendar time: ns.
std::string getDateString() const
Date in human readable format, e.g.
bool isLeapYear(int y) const
True if the year is a leap year in the Gregorian calendar: year is multiple of 4 and not multiple of...
EVENT::long64 timeStamp() const
64bit time stamp as used in LCEvent::getTimestamp().
int day() const
Calendar time: day.
int hour() const
Calendar time: hour.
int min() const
Calendar time: min.
const CalendarTime & calendarTime() const
Calendar time: year,month,day hour,min,sec and ns.
void operator+=(EVENT::long64 t)
Add the specified number of ns to the time.
static bool test(int nDates)
Tests the LCTime class with nDates random dates Returns true if successful - throws Exception in case...
LCTime()
Init with current time ( accuracy depends on OS/machine,etc.) in UTC/GMT.
Helper struct that holds the calendar time.
void convertFromCalTime()
int daysInYear(int y) const
The number if days in the given year in the Gregorian calendar.