#if defined(G__WIN32) && defined(__CINT__) && !defined(__MAKECINT__)
{
timeonaxis3();
}
#else
#include <time.h>
#include <stdio.h>
TString stime(time_t* t,
bool utc =
false,
bool display_time_zone =
true) {
if (utc) tt = gmtime(t);
else tt = localtime(t);
char buf[256];
if (display_time_zone) strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tt);
else strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tt);
}
double f = 1.8;
time_t offset[] = {0, 0, 1325376000, 1341100800};
time_t t[] = {1331150400, 1336417200, 0, 36000};
for(int i = 0; i < 4; ++i){
for(int gmt = 0; gmt < 2; ++gmt){
const char* opt = (gmt ? "gmt" : "local");
TGaxis* ga =
new TGaxis (.4, .25, 5., .25, t[i], t[i] + 1, 1,
"t");
a.SetTimeOffset(offset[i], opt);
const char* offsettimeformat = a.GetTimeFormat();
char buf[256];
if (offset[i] < t[i]) {
sprintf(buf, "#splitline{%s, %s}{offset: %ld, option %s}",
stime(t+i).
Data(), stime(t+i,
true).
Data(), offset[i], opt);
} else {
int h = t[i] / 3600;
int m = (t[i] - 3600 *
h) / 60 ;
int s = (t[i] - h * 3600 - m * 60);
sprintf(buf, "#splitline{%d h %d m %d s}{offset: %s, option %s}",
h, m, s, stime(offset + i, gmt).
Data(), opt);
}
time_t t_ = t[i] + offset[i];
sprintf(buf,
"Expecting: #color[2]{%s}", stime(&t_, gmt,
false).
Data());
}
}
return c;
}
#endif