UTC Time in TAxis

Hi all,

I have 3 years of data with timestamps as seconds since 1970 in UTC. Now I am trying to do some time plots, therefore I set

gStyle->SetTimeOffset(0)

Now it seems that on the time axis the dates are all in local time rather than in UTC. What do I have to do to get a real UTC-Axis?

Thanks, Mathias

Edit:

Just to give you an expression what I am talking about here is an example:

The filled times are UTC-seconds since 1970. As my local time is CET (or CEST) the times are shifted to +1h/+2h. So the axis starts at 1:00 and not at 0:00 as it should. Also there should only be two peeks at something like 8UTC and 18UTC. The two peaks are splitted into double peaks because of daylight saving time issues.

I don’t know if that will help you but an option parameter has been added to SetTimeOffset:

//______________________________________________________________________________
void TAxis::SetTimeOffset(Double_t toffset, Option_t *option)
{
   // Change the time offset
   // If option = "gmt" the time offset is treated as a GMT time.
                                                                                
[...]

First, thanks for the quick response. Unfortunately this will not help me very much. What I would need is an option that leads to an interpretion of the filled timestamps (and also the axis limits) as UTC times instead of local times. I’m not sure if this could be done within TStyle.

Have you tried it ?
There is comments in the TAxis/TGaxis code regarding UTC / GMT …
So that things are taken into account somehow. Before making any changes I would like to make sure they are needed.

Hi again. Now I had a try with the TAxis::SetTimeOffset and for sure you are right :slight_smile: Before I just used the TStyle::SetTimeOffset (by the way, is there a reason why there is no “gmt” option available in TStyle?).

By the way, the double peaks are NOT because of daylight saving time issues but because of a misinterpretation of my data, sorry for that :blush:

Thank you again, Mathias

I do not think there is a special reason for that. The GMT option was added later and, as it was not the more frequently requested, it was put at the axis level only. I guess that is the story …