12 #ifndef ROOT_TTimeStamp
13 #define ROOT_TTimeStamp
51 #if defined (_MSC_VER) && (_MSC_VER < 1900)
static time_t MktimeFromUTC(tm_t *tmstruct)
Equivalent of standard routine "mktime" but using the assumption that tm struct is filled with UTC...
void SetNanoSec(Int_t nsec)
TBuffer & operator>>(TBuffer &buf, TTimeStamp &ts)
Read time stamp from TBuffer.
friend Bool_t operator<(const TTimeStamp &lhs, const TTimeStamp &rhs)
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
friend Bool_t operator!=(const TTimeStamp &lhs, const TTimeStamp &rhs)
const char * AsString(const Option_t *option="") const
Return the date & time as a string.
Double_t AsGAST(Double_t UT1Offset=0) const
Return Greenwich apparent sidereal time (GAST) in hour-angle.
Bool_t operator==(const TTimeStamp &lhs, const TTimeStamp &rhs)
TTimeStamp(time_t t, Int_t nsec)
Buffer base class used for serializing objects.
This class implements a mutex interface.
friend Bool_t operator<=(const TTimeStamp &lhs, const TTimeStamp &rhs)
Double_t AsLMST(Double_t Longitude, Double_t UT1Offset=0) const
Return local mean sidereal time (LMST) in hour-angle, given a longitude in degrees.
Double_t AsJulianDate() const
TTimeStamp(const timespec_t &ts)
void NormalizeNanoSec()
Ensure that the fNanoSec field is in range [0,999999999].
friend Bool_t operator>=(const TTimeStamp &lhs, const TTimeStamp &rhs)
Bool_t operator<=(const TTimeStamp &lhs, const TTimeStamp &rhs)
struct timespec timespec_t
R__EXTERN TVirtualMutex * gTimeMutex
#define ClassDef(name, id)
void Add(const TTimeStamp &offset)
Add "offset" as a delta time.
Int_t GetDayOfYear(Bool_t inUTC=kTRUE, Int_t secOffset=0) const
Get the day of the year represented by this time stamp value.
void Copy(TTimeStamp &ts) const
Copy this to ts.
void Set()
Set Date/Time to current time as reported by the system.
timespec_t GetTimeSpec() const
TTimeStamp()
Default ctor.
void Print(const Option_t *option="") const
Print date and time.
static void DumpTMStruct(const tm_t &tmstruct)
Print out the "tm" structure: tmstruct.tm_year = year; // years since 1900 tmstruct.tm_mon = month-1; // months since Jan [0,11] tmstruct.tm_mday = day; // day of the month [1,31] tmstruct.tm_hour = hour; // hours since midnight [0,23] tmstruct.tm_min = min; // minutes after the hour [0,59] tmstruct.tm_sec = sec; // seconds after the minute [0,59] tmstruct.tm_wday // day of week [0,6] tmstruct.tm_yday // days in year [0,365] tmstruct.tm_isdst // DST [-1/0/1] (unknown,false,true).
std::ostream & operator<<(std::ostream &os, const TTimeStamp &ts)
Write time stamp to std::ostream.
Int_t GetWeek(Bool_t inUTC=kTRUE, Int_t secOffset=0) const
Get the week of the year.
UInt_t GetTime(Bool_t inUTC=kTRUE, Int_t secOffset=0, UInt_t *hour=0, UInt_t *min=0, UInt_t *sec=0) const
Return time in form of 123623 (i.e.
Double_t AsLAST(Double_t Longitude, Double_t UT1Offset=0) const
Return local apparent sidereal time (LAST) in hour-angle, given a longitude in degrees.
Bool_t operator>(const TTimeStamp &lhs, const TTimeStamp &rhs)
Bool_t operator<(const TTimeStamp &lhs, const TTimeStamp &rhs)
Bool_t operator!=(const TTimeStamp &lhs, const TTimeStamp &rhs)
friend Bool_t operator==(const TTimeStamp &lhs, const TTimeStamp &rhs)
The TTimeStamp encapsulates seconds and ns since EPOCH.
Bool_t IsLeapYear(Bool_t inUTC=kTRUE, Int_t secOffset=0) const
Is the year a leap year.
Double_t AsGMST(Double_t UT1Offset=0) const
Return Greenwich mean sidereal time (GMST) in hour-angle.
Double_t AsDouble() const
Bool_t operator>=(const TTimeStamp &lhs, const TTimeStamp &rhs)
UInt_t GetDate(Bool_t inUTC=kTRUE, Int_t secOffset=0, UInt_t *year=0, UInt_t *month=0, UInt_t *day=0) const
Return date in form of 19971224 (i.e.
Int_t GetDayOfWeek(Bool_t inUTC=kTRUE, Int_t secOffset=0) const
Method is using Zeller's formula for calculating the day number.
Int_t GetMonth(Bool_t inUTC=kTRUE, Int_t secOffset=0) const
Get the month of the year. Valid return values are between 1 and 12.
static Int_t GetZoneOffset()
Static method returning local (current) time zone offset from UTC.
friend Bool_t operator>(const TTimeStamp &lhs, const TTimeStamp &rhs)