[ROOT] TDatime

From: LEE, KERRY T. (JSC-SR) (UHCL) (kerry.t.lee1@jsc.nasa.gov)
Date: Tue Jul 08 2003 - 23:16:26 MEST


Dear Root team,

I am using ROOT 3.05.05 on Red Hat 9 gcc3.2.2.

I think there is an error in the TDatime::Convert() function.  I expect the
Convert function
to return the number of seconds since Jan 1, 1970 at 0:0:0 therefore the
result divided by 86,400 (number of seconds per day) should be an integer
for a time 0:0:0 any other day.  Below I put in Jan 1, 1995 0:0:0, so I
expect the result to be (25years*365days/year+6leap days)*86400sec/day =
788918400, but the result differs by 0.25 days.  Is this expected?

root [0] TDatime *da = new TDatime(1995,1,1,0,0,0);
root [1] UInt_t a = da->Convert();
root [2] a
(unsigned int)788940000
root [3] Double_t b = (Double_t)a;
root [4] Double_t days = b/3600/24;
root [5] days
(Double_t)9.13125000000000000e+03
root [6]

Thanks
Kerry



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:13 MET