I have a TTree with a unix timestamp (seconds since 1970…). Is there a convenient way to use TTree::Draw(“myvar:time”) with time on the X-axis in such a way that the axis labels are human-readable dates or times? I can subtract off the initial time and then divide by 606024 to get it in elapsed days, but I would really prefer a date like DD/MM/YY.
If I can’t do it directly from the TTree::Draw, what would be the recipe for converting a TGraph with epoch times on the x-axis into a new TGraph with date labels?
It looks like I figured it out (modulo time-zone errors, but my time scale is months so I’m not worried).
I have to subtract off the first time value so that all my times are in seconds since t0. Then I have to make a TDatime that corresponds to t0 and then Convert() it to feed to the SetTimeOffset method: