Re: [ROOT] TAxis::SetTimeFormat question

From: Thomas Bretz (tbretz@astro.uni-wuerzburg.de)
Date: Fri Aug 13 2004 - 16:22:47 MEST


Hi,

I DON'T WANT to change an environment variable, because talking about 
100 Users I make a bet that 98 don't change it not even if it is 
documented in the documentation of our software. I want to make sure, 
that ALWAYS the correct time is displayed!

Thomas.

Christian Vogel wrote:
> Hi,
> 
> On Tue, Aug 03, 2004 at 12:31:49PM +0200, Thomas Bretz wrote:
> 
>>how do I get rid of the summer-/winter-time treatment in 
>>TAxis::SetTimeFormat. I want that a histogram (showing UTC!) always 
>>shows the same time independant of the season.
> 
> 
> you can set the environment-variable TZ to UTC before starting root,
> under Unix in a bourne-like shell like this:
> 
> 	--- root session ---
> 	chris@pi2105:~$ date
> 	Wed Aug  4 17:12:43 CEST 2004
> 	chris@pi2105:~$ TZ=UTC date
> 	Wed Aug  4 15:12:45 UTC 2004
> 
> 	# ^- this just shows how the TZ variable affects the date command
> 	# v- root also uses strftime(), like date
> 
> 	chris@pi2105:~$ TZ=UTC root -l
> 	root [0] .x utc_time.C
> 	<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
> 	root [1] 
> 
> 	--- utc.time.C ---
> 	{
> 		Double_t a = time(NULL);
> 		Double_t x[]={a,a+60,a+120,a+180,a+240};
> 		Double_t y[]={1,2,3,4,5};
> 		TGraph g(5,x,y);
> 		g.GetXaxis()->SetTimeDisplay(1);
> 		g.GetXaxis()->SetTimeFormat("%H:%M:%S");
> 		g.Draw("A*");
> 	}
> 
> 
> .... shows a X-Axis labeled 15:13:00 .. 15:17:00 (UTC)
> 
> Also there is some interesting stuff on http://root.cern.ch/root/HowtoTimeAxis.html
> which I just now found...
> 
> 	Chris
> 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET