14 #if defined(G__WIN32) && defined(__CINT__) && !defined(__MAKECINT__) 33 TString stime(time_t* t,
bool utc =
false,
bool display_time_zone =
true) {
35 if (utc) tt = gmtime(t);
36 else tt = localtime(t);
38 if (display_time_zone) strftime(buf,
sizeof(buf),
"%Y-%m-%d %H:%M:%S %Z", tt);
39 else strftime(buf,
sizeof(buf),
"%Y-%m-%d %H:%M:%S", tt);
66 time_t offset[] = {0, 0, 1325376000, 1341100800};
67 time_t t[] = {1331150400, 1336417200, 0, 36000};
75 for(
int i = 0; i < 4; ++i){
76 for(
int gmt = 0; gmt < 2; ++gmt){
77 const char* opt = (gmt ?
"gmt" :
"local");
83 TGaxis* ga =
new TGaxis (.4, .25, 5., .25, t[i], t[i] + 1, 1,
"t");
84 ga->
SetTimeFormat(
"TGaxis label: #color[2]{%Y-%m-%d %H:%M:%S}");
97 TAxis a(10, 0, 1600000000);
98 a.SetTimeOffset(offset[i], opt);
99 const char* offsettimeformat =
a.GetTimeFormat();
102 if (offset[i] < t[i]) {
103 sprintf(buf,
"#splitline{%s, %s}{offset: %ld, option %s}",
104 stime(t+i).Data(), stime(t+i,
true).Data(), offset[i], opt);
107 int m = (t[i] - 3600 *
h) / 60 ;
108 int s = (t[i] - h * 3600 - m * 60);
109 sprintf(buf,
"#splitline{%d h %d m %d s}{offset: %s, option %s}",
110 h, m, s, stime(offset + i, gmt).Data(), opt);
113 tex2->
DrawLatex(.01, .50, offsettimeformat);
114 time_t t_ = t[i] + offset[i];
115 sprintf(buf,
"Expecting: #color[2]{%s}", stime(&t_, gmt,
false).Data());
117 if(i > 0) l.
DrawLine(0, 0.95, 1, 0.95);
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual TLine * DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetTopMargin(Float_t topmargin)
Set Pad top margin in fraction of the pad height.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
To draw Mathematical Formula.
virtual int CompileMacro(const char *filename, Option_t *opt="", const char *library_name="", const char *build_dir="", UInt_t dirmode=0)
This method compiles and loads a shared library containing the code from the file "filename"...
TLatex * DrawLatex(Double_t x, Double_t y, const char *text)
Make a copy of this object with the new parameters And copy object attributes.
void SetTimeFormat(const char *tformat)
Change the format used for time plotting.
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
void SetLabelSize(Float_t labelsize)
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetBottomMargin(Float_t bottommargin)
Set Pad bottom margin in fraction of the pad height.
Class to manage histogram axis.
R__EXTERN TSystem * gSystem
void SetLabelOffset(Float_t labeloffset)
void SetLabelFont(Int_t labelfont)
static constexpr double s
virtual void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
void SetTimeOffset(Double_t toffset, Option_t *option="local")
Change the time offset. If option = "gmt", set display mode to GMT.
void SetLabelColor(Int_t labelcolor)
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
virtual void SetLeftMargin(Float_t leftmargin)
Set Pad left margin in fraction of the pad width.