00001
00002
00003
00004 #ifndef ROOT_TUnixTime
00005 #define ROOT_TUnixTime
00006
00007
00009
00010
00011
00012
00014 #include "TString.h"
00015 class TDatime;
00016 struct tm;
00017 class TUnixTime
00018 {
00019 public:
00020 TUnixTime(UInt_t utime = 0);
00021 TUnixTime(Int_t date,Int_t time,int gmt);
00022 TUnixTime(const TDatime &tdt,int gmt);
00023 virtual ~TUnixTime(){;}
00024 UInt_t operator()() const { return fUTime;}
00025 TUnixTime &operator =(UInt_t ut) { fUTime =ut ; return *this;}
00026 TUnixTime &operator+=(Int_t sec) { fUTime+=sec; return *this;}
00027 UInt_t GetUTime() { return fUTime;}
00028 void GetLTime(Int_t &idate, Int_t &itime);
00029 void GetGTime(Int_t &idate, Int_t &itime);
00030 TString GetLString();
00031 TString GetGString();
00032
00033 void SetUTime(UInt_t utime){ fUTime=utime;}
00034 void SetLTime(Int_t idate, Int_t itime);
00035 void SetGTime(Int_t idate, Int_t itime);
00036 void SetLTime(const TDatime &loc);
00037 void SetGTime(const TDatime &gmt);
00038 static UInt_t Convert(const TDatime &dt,int gmt);
00039 private:
00040 void SetGTime(const struct tm *gt);
00041 void SetLTime(const struct tm *gt);
00042
00043
00044 UInt_t fUTime;
00045
00046 ClassDef(TUnixTime,1)
00047
00048 };
00049 #endif //ROOT_TUnixTime