1 #include <boost/format.hpp>
3 #include <utl/TimeStamp.h>
4 #include <utl/ErrorLogger.h>
5 #include <utl/AugerException.h>
6 #include <utl/UTCDateTime.h>
15 TimeStamp::SetNormalized(
long sec,
double nsec)
22 }
else if (nsec >= sperns) {
31 fGPSNanoSecond = nsec;
35 err <<
"operation for "
36 "sec = " << sec <<
" nsec = " << nsec <<
" "
37 "results in time before GPS Epoch";
39 fGPSSecond = fGPSNanoSecond = 0;
49 gettimeofday(&tv,
nullptr);
50 const tm*
const time = gmtime(&tv.tv_sec);
70 return os << format(
"%1%:%2$012.2f (GPS)") % ts.
GetGPSSecond() %
ns;
A TimeStamp holds GPS second and nanosecond for some event.
Exception for reporting variable out of valid range.
ostream & operator<<(ostream &os, const Separator< T > &s)
constexpr double nanosecond
unsigned long GetGPSSecond() const
GPS second.
double GetGPSNanoSecond() const
GPS nanosecond.
TimeStamp GetCurrentSystemTime()
get current time as reported by system
#define ERROR(message)
Macro for logging error messages.
TimeStamp GetTimeStamp() const