I’ve read a lot of the postings on getting a timescale on a histogram or TGraph axis, but I’m still having problems. Perhaps I don’t understand what is really going on…
If I manually create UNIX timestamps (seconds since the 1 January 1970 00:00:00 UTC epoch) and then plot them, they are still showing up in the local time (Eastern Daylight Time at the moment), EVEN if I set the time offset to use GMT
So the following code produces the attached plot
{
Double_t X[10];
Double_t Y[10];
// creates TEN timestamps every 15 minutes from
// 15:00 1 January 1970 GMT to 17:15 1 January 1970 GMT
for (Int_t i=0; i<10; i++)
{
X[i] = 15.0*3600.0 + i*15.0*60;
Y[i] = 10.0;
}
// attempt to plot this data:
TGraph *gr = new TGraph(10, X, Y);
gr->SetMarkerStyle(kFullDotLarge);
gr->GetXaxis()->SetTimeDisplay(1);
gr->GetXaxis()->SetTimeOffset(0, "gmt");
gr->GetXaxis()->SetTimeFormat("%H:%M");
gr->Draw("ap");
}
What I THINK should happen is the time markers should start at 15:00 and then go up 17:15, but the plot still seems to be doing the conversion to EDT.
Since I have done everything I can think of to stay in GMT, why is the axis still doing this?
Note this is version 5.26/00b on Ubuntu 9.10, and my system clock is set to EDT.