Wrong year displayed with time on a TGraph axis

From: Brett Viren <bv_at_bnl.gov>
Date: Fri, 04 Mar 2005 12:58:58 -0500


Hi,

The following produces years displayed as "30" instead of "05".

//--------------------//

{

     graph = new TGraph;
     graph->SetPoint(0,1109363595.051000,1.0);
     graph->SetPoint(0,1109376948.212000,2.0);
     graph->Draw("AB");
     frame = graph->GetHistogram();
     axis = frame->GetXaxis();
     axis->SetTimeDisplay(1);
     axis->SetTimeFormat("%y-%m-%d %H:%M:%S");
     axis->SetNdivisions(202,false);
     axis->SetAxisColor(2);
     c1->Modified();
     c1->Update();

}
//--------------------//

That first timestamp should correspond to Fri Feb 25 20:33:15 2005 UTC

I'm using CVS from last night on Debian x86 GCC 3.3.5.

Any ideas?

Also, there is a conflict in the documentation for TAxis::SetTimeFormat. It states that one can use the codes as defined in strftime(3). However, in that man page it says:

  %F Equivalent to %Y-%m-%d (the ISO 8601 date format). (C99)

whereas SetTimeFormat() uses this code to define a time offset.

Thanks,
-Brett. Received on Fri Mar 04 2005 - 18:59:32 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET