209 sscanf(DateString,
"%4d-%02d-%02d %02d:%02d:%02d",
210 &Y, &M, &D, &
h, &
m, &s);
211 Set(Y, M, D,
h,
m, s);
228 sscanf(DateString,
"%4d-%02d-%02d-%02d.%02d",
231 Set(Y, M, D,
h,
m, s);
248 sscanf(DateString,
"%4d-%02d-%02d.%02d:%02d",
251 Set(Y, M, D,
h,
m, s);
263 sscanf(DMYString,
"%2d/%2d/%4d", &D, &M, &Y);
264 Set(Y, M, D, 0, 0, 0);
282 if (sscanf(tmp.
Data(),
"%02d%3s%02d %02dH%02dM%02dS", &D,
Month, &Y, &
H, &M, &
S) == 6) {
287 Set(Y, month, D,
H, M,
S);
305 if (sscanf(tmp.
Data(),
"%02d-%02d-%02d %02dH%02dM%02dS", &D, &
Month, &Y, &
H, &M, &
S) == 6) {
339 Error(
"SetGanacqDate",
"Format is incorrect: %s (should be like \"29-SEP-2005 09:42:17.00\" or \"29-SEP-05 09:42:17\")",
344 KV__TOBJSTRING_TO_INT(toks, 0, day)
350 KV__TOBJSTRING_TO_INT(toks, 2, year)
356 (year < 82 ? year += 2000 : year += 1900);
358 KV__TOBJSTRING_TO_INT(toks, 3, hour)
359 KV__TOBJSTRING_TO_INT(toks, 4,
min)
360 KV__TOBJSTRING_TO_INT(toks, 5, sec)
362 Set(year, month, day, hour,
min, sec);
375 return Form(
"%d-%s-%4d %02d:%02d:%02d.00",
387 return Form(
"%02d/%02d/%4d",
465 if (sscanf(tmp.
Data(),
"%02d%3s%02d %02dH%02dM%02dS", &D,
Month, &Y, &
H, &M, &
S) == 6)
485 if (sscanf(tmp.
Data(),
"%02d-%02d-%02d %02dH%02dM%02dS", &D, &
Month, &Y, &
H, &M, &
S) == 6)
502 if (sscanf(date,
"%4d-%02d-%02d %02d:%02d:%02d",
503 &Y, &M, &D, &
h, &
m, &s) != 6)
return kFALSE;
519 if (sscanf(date,
"%4d-%02d-%02d-%02d.%02d",
520 &Y, &M, &D, &
h, &
m) != 5)
return kFALSE;
536 if (sscanf(date,
"%4d-%02d-%02d.%02d:%02d",
537 &Y, &M, &D, &
h, &
m) != 5)
return kFALSE;
560 year_ins -= ref_year;
566 total_ins += year_ins;
570 month_ins *= 365.25 / 12;
575 total_ins += month_ins;
char * Form(const char *fmt,...)
Extension of TDatime to handle various useful date formats.
static const Char_t * Month(Int_t m)
Double_t GetNumberOfSeconds(Int_t ref_year=0)
void SetDMYDate(const Char_t *DMYString)
Set date from string in format "DD/MM/YYYY".
void SetIRODSDate(const Char_t *IRODSDateString)
static Bool_t IsGANACQFormat(const Char_t *date)
static Bool_t IsSRBFormat(const Char_t *date)
TString fStr
internal buffer used by String method
const Char_t * String(EKVDateFormat fmt=kCTIME)
static Bool_t IsSQLFormat(const Char_t *date)
static Bool_t IsGANACQ2010Format(const Char_t *date)
void SetSQLDate(const Char_t *SQLDateString)
void SetGanacqNarvalDate(const Char_t *GanacqDateString)
const Char_t * AsDMYDateString() const
KVDatime & operator=(const KVDatime &)
copy assignment operator
const Char_t * AsGanacqDateString() const
void SetSRBDate(const Char_t *SRBDateString)
static Int_t ndatime
counter
static Bool_t IsGANACQNarvalFormat(const Char_t *date)
static KVList * fmonths
list of months
static Bool_t IsIRODSFormat(const Char_t *date)
void SetGanacq2010Date(const Char_t *GanacqDateString)
Double_t GetDureeInSeconds(KVDatime from)
void SetGanacqDate(const Char_t *GanacqDateString)
Extended TList class which owns its objects by default.
virtual TObject * FindObject(const char *name) const
virtual TObject * At(Int_t idx) const
virtual void Add(TObject *obj)
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
const char * AsSQLString() const
TDatime & operator=(const TDatime &d)
const char * AsString() const
Int_t GetEntries() const override
TObject * At(Int_t idx) const override
virtual Int_t IndexOf(const TObject *obj) const
const char * Data() const
TObjArray * Tokenize(const TString &delim) const
TString & ReplaceAll(const char *s1, const char *s2)
RooArgSet S(Args_t &&... args)
double min(double x, double y)