Hi Anton, the axis displays time in UTC (it uses gmtime() to get the time value fron TDatime). Thats why you see the 2 hour offset. Cheers, Fons. Anton Fokin wrote: > > Hello, > > I think the macro below shows a bug in either Datetime::Convert or in > drawing time labels. It always gives two hours shift, i.e. I see 6 > instead of 8 and 14 instead of 16 hours. > > Regards, > Anton > > { > TDatime Datime1; > TDatime Datime2; > > Datime1.Set(98, 10, 24, 8, 20, 0); > Datime2.Set(98, 10, 24, 16, 20, 0); > > TGraph Graph; > > Graph.SetPoint(0, Datime1.Convert(), 10); > Graph.SetPoint(1, Datime2.Convert(), 20); > > TH2F *Hist = new TH2F("Hist", "Hist", 100, Datime1.Convert(), > Datime2.Convert(), 100, 0, 50); > > Hist->GetXaxis()->SetLabelFont(43); > Hist->GetYaxis()->SetLabelFont(43); > Hist->GetXaxis()->SetLabelSize(14); > Hist->GetYaxis()->SetLabelSize(14); > Hist->GetXaxis()->SetTimeDisplay(1); > Hist->GetXaxis()->SetTimeFormat("%H:%M"); > Hist->GetXaxis()->UnZoom(); > Hist->GetYaxis()->UnZoom(); > Hist->SetStats(kFALSE); > > Hist->Draw(); > > Graph.Draw(); > } -- 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 7677910
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:57 MET