Re: [ROOT] format of TDatime::GetDateTime().

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Thu May 30 2002 - 12:48:58 MEST


Hi Harufumi,

  you misunderstood the usage of GetDateTime(). The input must be in
TDatime format, as obtained from TDatime::Get(). Also note that 70 is an
illegal time format. Time must be in hhmmss format, so 70 is 110.

I've made the comments in the code more clear in this respect.

Cheers, Fons.



On Thu, 2002-05-30 at 10:49, Harufumi Tsuchiya wrote:
> 
> Hi ROOTers,
> 
> I found that strange behavior of GetDateTime of TDatime object.
> 
> root [0] TDatime t;
> root [1] Int_t date, time;
> root [2] t.GetDateTime(1, date, time);
> root [3] cout << date << " " << time << endl;
> 19950000 1      
> root [4] t.GetDateTime(50, date, time);      
> root [5] cout << date << " " << time << endl;
> 19950000 50     
> root [6] t.GetDateTime(60, date, time);      
> root [7] cout << date << " " << time << endl;
> 19950000 60     
> root [8] t.GetDateTime(70, date, time);      
> root [9] cout << date << " " << time << endl;
> 19950000 106    
> 
> In the case of bottom line, I thought that return values
> were 19950101 and 110. 
> And in the case of t.GetDateTime(60, date, time), 
> I thought that return values were 19950101 and 100.
> Also, I thought return value for date was 19950101 not 19950000.
> 
> My thinking is wrong ?
> 
> Also, there is diffrence of document and real case.
> Document (http://root.cern.ch/root/htmldoc/TDatime.html#TDatime:GetDateTime)
> says that return values of GetDateTime() has
> the form such a like 950223 for date. But, in real case,
> the date format is 19950223.
> 
> I use ROOT v 3.03/05 on IRIX using g++ 2.95.2.
> 
> Thanks,
> 
> Harufumi Tsuchiya.
> 
> 
> 
> 
> 
> 
> 
> 
-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7679480



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:54 MET