![]() |
KaliVeda
Toolkit for HIC analysis
|
Extension of TDatime to handle various useful date formats.
This class can 'read' and 'write' date and timestamps in many different formats:
29-SEP-2005 09:42:17.0027Nov10_02h07m40s12-04-18_17h09m41s2007-05-02 14:52:182008-12-19-15.212008-12-19.15:2119/12/2008 Definition at line 34 of file KVDatime.h.
#include <KVDatime.h>

Public Types | |
| enum | EKVDateFormat { kCTIME , kGANACQ , kSQL , kSRB , kIRODS , kDMY , kGANACQ2010 , kGANACQNarval } |
Public Member Functions | |
| KVDatime () | |
| KVDatime (const Char_t *DateString, EKVDateFormat f=kGANACQ) | |
| KVDatime (const KVDatime &d) | |
| KVDatime (const TDatime &d) | |
| KVDatime (Int_t date, Int_t time) | |
| KVDatime (Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec) | |
| KVDatime (UInt_t tloc, Bool_t dosDate=kFALSE) | |
| const Char_t * | AsDMYDateString () const |
| const Char_t * | AsGanacqDateString () const |
| Double_t | GetDureeInSeconds (KVDatime from) |
| Double_t | GetNumberOfSeconds (Int_t ref_year=0) |
| KVDatime & | operator= (const KVDatime &) |
| copy assignment operator More... | |
| void | SetDMYDate (const Char_t *DMYString) |
| Set date from string in format "DD/MM/YYYY". More... | |
| void | SetGanacq2010Date (const Char_t *GanacqDateString) |
| void | SetGanacqDate (const Char_t *GanacqDateString) |
| void | SetGanacqNarvalDate (const Char_t *GanacqDateString) |
| void | SetIRODSDate (const Char_t *IRODSDateString) |
| void | SetSQLDate (const Char_t *SQLDateString) |
| void | SetSRBDate (const Char_t *SRBDateString) |
| const Char_t * | String (EKVDateFormat fmt=kCTIME) |
Static Public Member Functions | |
| static Bool_t | IsGANACQ2010Format (const Char_t *date) |
| static Bool_t | IsGANACQFormat (const Char_t *date) |
| static Bool_t | IsGANACQNarvalFormat (const Char_t *date) |
| static Bool_t | IsIRODSFormat (const Char_t *date) |
| static Bool_t | IsSQLFormat (const Char_t *date) |
| static Bool_t | IsSRBFormat (const Char_t *date) |
| static const Char_t * | Month (Int_t m) |
| Enumerator | |
|---|---|
| kCTIME | |
| kGANACQ | |
| kSQL | |
| kSRB | |
| kIRODS | |
| kDMY | |
| kGANACQ2010 | |
| kGANACQNarval | |
Definition at line 45 of file KVDatime.h.
| KVDatime::KVDatime | ( | ) |
Definition at line 50 of file KVDatime.cpp.
| KVDatime::KVDatime | ( | const Char_t * | DateString, |
| EKVDateFormat | f = kGANACQ |
||
| ) |
if f = KVDatime::kGANACQ:
Decodes GANIL acquisition (INDRA) run-sheet format date into a TDatime
Format of date string is: 29-SEP-2005 09:42:17.00
if f = KVDatime::kGANACQ2010:
Decodes GANIL acquisition runfile format date into a TDatime
Format of date string is: 27Nov10_02h07m40s
if f = KVDatime::kGANACQNarval:
Decodes GANIL Narval acquisition runfile format date into a TDatime
Format of date string is: 12-04-18_17h09m41s
if f = KVDatime::kSQL:
Decodes SQL format date into a TDatime (i.e. same format as returned by TDatime::AsSQLString(): 2007-05-02 14:52:18)
if f = KVDatime::kSRB:
Decodes SRB format date into a TDatime
Format of date string is: 2008-12-19-15.21
if f = KVDatime::kIRODS:
Decodes IRODS format date into a TDatime
Format of date string is: 2008-12-19.15:21
if f = KVDatime::kDMY:
Decodes DMY format date into a TDatime
Format of date string is: 19/12/2008
Definition at line 99 of file KVDatime.cpp.
| KVDatime::KVDatime | ( | const KVDatime & | d | ) |
Definition at line 173 of file KVDatime.cpp.
| KVDatime::KVDatime | ( | const TDatime & | d | ) |
Definition at line 177 of file KVDatime.cpp.
| KVDatime::KVDatime | ( | UInt_t | tloc, |
| Bool_t | dosDate = kFALSE |
||
| ) |
Definition at line 181 of file KVDatime.cpp.
| KVDatime::KVDatime | ( | Int_t | date, |
| Int_t | time | ||
| ) |
Definition at line 185 of file KVDatime.cpp.
| KVDatime::KVDatime | ( | Int_t | year, |
| Int_t | month, | ||
| Int_t | day, | ||
| Int_t | hour, | ||
| Int_t | min, | ||
| Int_t | sec | ||
| ) |
Definition at line 189 of file KVDatime.cpp.
| const Char_t * KVDatime::AsDMYDateString | ( | ) | const |
Definition at line 388 of file KVDatime.cpp.
| const Char_t * KVDatime::AsGanacqDateString | ( | ) | const |
Return date and time string with format "29-SEP-2005 09:42:17.00" Copy the string immediately if you want to reuse/keep it
Definition at line 376 of file KVDatime.cpp.
| Double_t KVDatime::GetDureeInSeconds | ( | KVDatime | from | ) |
Definition at line 588 of file KVDatime.cpp.
| Double_t KVDatime::GetNumberOfSeconds | ( | Int_t | ref_year = 0 | ) |
Definition at line 552 of file KVDatime.cpp.
|
static |
Static method, returns kTRUE if 'date' is in new (2010) format of GANIL acquisition run files, e.g. run_0058.dat.27Nov10_02h07m40s
Definition at line 453 of file KVDatime.cpp.
|
static |
Static method, returns kTRUE if 'date' is in format of GANIL acquisition e.g. 29-SEP-2005 09:42:17.00
Definition at line 436 of file KVDatime.cpp.
|
static |
Static method, returns kTRUE if 'date' is in format of GANIL Narval acquisition run files, e.g. run_0058.dat.27-11-10_02h07m40s
Definition at line 474 of file KVDatime.cpp.
|
static |
Static method, returns kTRUE if 'date' is in IRODS format e.g. 2008-12-19.15:21
Definition at line 528 of file KVDatime.cpp.
|
static |
Static method, returns kTRUE if 'date' is in SQL format e.g. 2007-05-02 14:52:18
Definition at line 494 of file KVDatime.cpp.
|
static |
Static method, returns kTRUE if 'date' is in SRB format e.g. 2008-12-19-15.21
Definition at line 511 of file KVDatime.cpp.
|
static |
Definition at line 543 of file KVDatime.cpp.
copy assignment operator
Definition at line 197 of file KVDatime.cpp.
| void KVDatime::SetDMYDate | ( | const Char_t * | DMYString | ) |
Set date from string in format "DD/MM/YYYY".
Definition at line 264 of file KVDatime.cpp.
| void KVDatime::SetGanacq2010Date | ( | const Char_t * | GanacqDateString | ) |
Decodes dates in new (2010) format of GANIL acquisition run files, e.g. run_0058.dat.27Nov10_02h07m40s
Definition at line 278 of file KVDatime.cpp.
| void KVDatime::SetGanacqDate | ( | const Char_t * | GanacqDateString | ) |
Decodes GANIL acquisition (INDRA) run-sheet format date into a TDatime Format of date string is: 29-SEP-2005 09:42:17.00 or 29-SEP-2005 09:42:17 or 29-SEP-05 09:42:17.00 or 29-SEP-05 09:42:17
If format is not respected, we set to current time & date
Definition at line 331 of file KVDatime.cpp.
| void KVDatime::SetGanacqNarvalDate | ( | const Char_t * | GanacqDateString | ) |
Decodes dates in format of GANIL Narval acquisition run files, e.g. run_0058.dat.27-11-10_02h07m40s
Definition at line 305 of file KVDatime.cpp.
| void KVDatime::SetIRODSDate | ( | const Char_t * | DateString | ) |
Decodes IRODS format date into a TDatime Format of date string is: 2008-12-19.15:21
Definition at line 246 of file KVDatime.cpp.
| void KVDatime::SetSQLDate | ( | const Char_t * | DateString | ) |
Decodes SQL format date into a TDatime (i.e. same format as returned by TDatime::AsSQLString(): "2007-05-02 14:52:18")
Definition at line 209 of file KVDatime.cpp.
| void KVDatime::SetSRBDate | ( | const Char_t * | DateString | ) |
Decodes SRB format date into a TDatime Format of date string is: 2008-12-19-15.21
Definition at line 226 of file KVDatime.cpp.
| const Char_t * KVDatime::String | ( | EKVDateFormat | fmt = kCTIME | ) |
Returns date & time as a string in required format: fmt = kCTIME (default) : ctime format e.g. Thu Apr 10 10:48:34 2008 fmt = kSQL : SQL format e.g. 1997-01-15 20:16:28 fmt = kGANACQ : GANIL acquisition format e.g. 29-SEP-2005 09:42:17.00 fmt = kDMY : DD/MM/YYYY
Definition at line 404 of file KVDatime.cpp.