1 #ifndef GAUDIKERNEL_TIME_H 2 #define GAUDIKERNEL_TIME_H 1 33 typedef struct _FILETIME FILETIME;
64 TimeSpan (ValueType secs,
int nsecs);
65 TimeSpan (
int days,
int hours,
int mins,
int secs,
int nsecs);
67 int days (
void)
const;
68 int hours (
void)
const;
69 int minutes (
void)
const;
70 ValueType seconds (
void)
const;
72 int lastHours (
void)
const;
73 int lastMinutes (
void)
const;
74 int lastSeconds (
void)
const;
75 int lastNSeconds (
void)
const;
83 ValueType
ns (
void)
const;
235 static const int SECS_PER_DAY = 86400;
238 static const int SECS_PER_HOUR = 3600;
241 static const ValueType SEC_NSECS = 1000000000;
245 Time (ValueType nsecs);
246 Time (ValueType secs,
int nsecs);
247 Time (
int year,
int month,
int day,
int hour,
int min,
int sec,
248 ValueType nsecs,
bool local =
true);
254 static Time epoch (
void);
256 static Time max (
void);
258 static Time current (
void);
260 static Time from (
const FILETIME *systime);
262 static Time build (
bool local,
const tm &base,
TimeSpan diff = 0);
264 tm split (
bool local,
int *nsecpart = 0)
const;
265 tm utc (
int *nsecpart = 0)
const;
266 tm local (
int *nsecpart = 0)
const;
268 int year (
bool local)
const;
269 int month (
bool local)
const;
270 int day (
bool local)
const;
271 int hour (
bool local)
const;
272 int minute (
bool local)
const;
273 int second (
bool local)
const;
274 int nsecond (
void)
const;
275 int weekday (
bool local)
const;
276 bool isdst (
bool local)
const;
278 ValueType utcoffset (
int *daylight = 0)
const;
279 const char * timezone (
int *daylight = 0)
const;
284 ValueType
ns (
void)
const;
287 std::string nanoformat (
size_t minwidth = 1,
size_t maxwidth = 9)
const;
289 static bool isLeap (
int year);
292 static unsigned toDosDate (
Time time);
293 static Time fromDosDate (
unsigned dosDate);
308 #endif // GAUDIKERNEL_TIME_H
TimeException(std::string Message="unspecified exception", std::string Tag="*Gaudi::Time*", StatusCode Code=StatusCode::FAILURE)
Define general base for Gaudi exception.
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
virtual ~TimeException()
Destructor needed to match the signature of GaudiException::~GaudiException().
void TimeAssert(bool cond, const std::string &msg="time assertion failed") const
Months
Symbolic names for months.
This class is used for returning status codes from appropriate routines.
Exception thrown by Gaudi::Time.
Helper functions to set/get the application return code.