12#ifndef ROOT_TTimeStamp
13#define ROOT_TTimeStamp
46#if defined (_MSC_VER) && (_MSC_VER < 1900)
#define ClassDef(name, id)
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)
TBuffer & operator>>(TBuffer &buf, TTimeStamp &ts)
Read time stamp from TBuffer.
Bool_t operator!=(const TTimeStamp &lhs, const TTimeStamp &rhs)
struct timespec timespec_t
Bool_t operator>(const TTimeStamp &lhs, const TTimeStamp &rhs)
R__EXTERN TVirtualMutex * gTimeMutex
Bool_t operator==(const TTimeStamp &lhs, const TTimeStamp &rhs)
std::ostream & operator<<(std::ostream &os, const TTimeStamp &ts)
Write time stamp to std::ostream.
Buffer base class used for serializing objects.
The TTimeStamp encapsulates seconds and ns since EPOCH.
timespec_t GetTimeSpec() const
Bool_t IsLeapYear(Bool_t inUTC=kTRUE, Int_t secOffset=0) const
Is the year a leap year.
friend Bool_t operator>=(const TTimeStamp &lhs, const TTimeStamp &rhs)
friend Bool_t operator<=(const TTimeStamp &lhs, const TTimeStamp &rhs)
TTimeStamp(const timespec_t &ts)
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.
Int_t GetDayOfYear(Bool_t inUTC=kTRUE, Int_t secOffset=0) const
Get the day of the year represented by this time stamp value.
friend Bool_t operator<(const TTimeStamp &lhs, const TTimeStamp &rhs)
void SetNanoSec(Int_t nsec)
static void DumpTMStruct(const tm_t &tmstruct)
Print out the "tm" structure:
Int_t GetWeek(Bool_t inUTC=kTRUE, Int_t secOffset=0) const
Get the week of the year.
TTimeStamp()
Default ctor.
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.
Double_t AsJulianDate() const
void Add(const TTimeStamp &offset)
Add "offset" as a delta time.
void Copy(TTimeStamp &ts) const
Copy this to ts.
Int_t GetDayOfWeek(Bool_t inUTC=kTRUE, Int_t secOffset=0) const
Method is using Zeller's formula for calculating the day number.
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.
friend Bool_t operator!=(const TTimeStamp &lhs, const TTimeStamp &rhs)
Double_t AsGMST(Double_t UT1Offset=0) const
Return Greenwich mean sidereal time (GMST) in hour-angle.
void Print(const Option_t *option="") const
Print date and time.
void Set()
Set Date/Time to current time as reported by the system.
TTimeStamp(time_t t, Int_t nsec)
Double_t AsGAST(Double_t UT1Offset=0) const
Return Greenwich apparent sidereal time (GAST) in hour-angle.
friend Bool_t operator>(const TTimeStamp &lhs, const TTimeStamp &rhs)
static Int_t GetZoneOffset()
Static method returning local (current) time zone offset from UTC.
static time_t MktimeFromUTC(tm_t *tmstruct)
Equivalent of standard routine "mktime" but using the assumption that tm struct is filled with UTC,...
friend Bool_t operator==(const TTimeStamp &lhs, const TTimeStamp &rhs)
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.
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.
Double_t AsDouble() const
const char * AsString(const Option_t *option="") const
Return the date & time as a string.
void NormalizeNanoSec()
Ensure that the fNanoSec field is in range [0,999999999].
This class implements a mutex interface.