KaliVeda
1.13/01
Heavy-Ion Analysis Toolkit
|
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.00
27Nov10_02h07m40s
12-04-18_17h09m41s
2007-05-02 14:52:18
2008-12-19-15.21
2008-12-19.15:21
19/12/2008
Definition at line 32 of file 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) | |
virtual | ~ KVDatime () |
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) |
Public Member Functions inherited from TDatime | |
TDatime () | |
TDatime (const char *sqlDateTime) | |
TDatime (const TDatime &d) | |
TDatime (Int_t date, Int_t time) | |
TDatime (Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec) | |
TDatime (UInt_t tloc, Bool_t dosDate=kFALSE) | |
virtual | ~TDatime () |
const char * | AsSQLString () const |
const char * | AsString () const |
const char * | AsString (char *out) const |
UInt_t | Convert (Bool_t toGMT=kFALSE) const |
void | Copy (TDatime &datime) const |
void | FillBuffer (char *&buffer) |
UInt_t | Get () const |
Int_t | GetDate () const |
Int_t | GetDay () const |
Int_t | GetDayOfWeek () const |
Int_t | GetHour () const |
Int_t | GetMinute () const |
Int_t | GetMonth () const |
Int_t | GetSecond () const |
Int_t | GetTime () const |
Int_t | GetYear () const |
TDatime & | operator= (const TDatime &d) |
void | Print (Option_t *option="") const |
void | ReadBuffer (char *&buffer) |
void | Set () |
void | Set (const char *sqlDateTime) |
void | Set (Int_t date, Int_t time) |
void | Set (Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec) |
void | Set (UInt_t tloc, Bool_t dosDate=kFALSE) |
Int_t | Sizeof () const |
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) |
Static Public Member Functions inherited from TDatime | |
static Int_t | GetDateFromGlobalDay (Int_t day) |
static void | GetDateTime (UInt_t datetime, Int_t &date, Int_t &time) |
static Int_t | GetGlobalDayFromDate (Int_t date) |
static Int_t | GetLegalGlobalDayFromDate (Int_t date) |
Private Member Functions | |
void | init () |
Private Attributes | |
TString | fStr |
internal buffer used by String method More... | |
Static Private Attributes | |
static KVList * | fmonths = 0 |
list of months More... | |
static Int_t | ndatime = 0 |
counter More... | |
Additional Inherited Members | |
Protected Attributes inherited from TDatime | |
UInt_t | fDatime |
#include <KVDatime.h>
Enumerator | |
---|---|
kCTIME | |
kGANACQ | |
kSQL | |
kSRB | |
kIRODS | |
kDMY | |
kGANACQ2010 | |
kGANACQNarval |
Definition at line 40 of file KVDatime.h.
KVDatime::KVDatime | ( | ) |
Definition at line 52 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 102 of file KVDatime.cpp.
|
inline |
Definition at line 53 of file KVDatime.h.
|
inline |
Definition at line 59 of file KVDatime.h.
Definition at line 64 of file KVDatime.h.
Definition at line 69 of file KVDatime.h.
Definition at line 74 of file KVDatime.h.
|
virtual |
const Char_t * KVDatime::AsDMYDateString | ( | ) | const |
Definition at line 385 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 371 of file KVDatime.cpp.
Definition at line 590 of file KVDatime.cpp.
Definition at line 554 of file KVDatime.cpp.
called by all ctors sets up static list of months' names if not already done
Definition at line 25 of file KVDatime.cpp.
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 455 of file KVDatime.cpp.
Static method, returns kTRUE if 'date' is in format of GANIL acquisition e.g. 29-SEP-2005 09:42:17.00
Definition at line 433 of file KVDatime.cpp.
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 476 of file KVDatime.cpp.
Static method, returns kTRUE if 'date' is in IRODS format e.g. 2008-12-19.15:21
Definition at line 530 of file KVDatime.cpp.
Static method, returns kTRUE if 'date' is in SQL format e.g. 2007-05-02 14:52:18
Definition at line 496 of file KVDatime.cpp.
Static method, returns kTRUE if 'date' is in SRB format e.g. 2008-12-19-15.21
Definition at line 513 of file KVDatime.cpp.
Definition at line 545 of file KVDatime.cpp.
copy assignment operator
Definition at line 179 of file KVDatime.cpp.
Set date from string in format "DD/MM/YYYY".
Definition at line 259 of file KVDatime.cpp.
Decodes dates in new (2010) format of GANIL acquisition run files, e.g. run_0058.dat.27Nov10_02h07m40s
Definition at line 273 of file KVDatime.cpp.
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 323 of file KVDatime.cpp.
Decodes dates in format of GANIL Narval acquisition run files, e.g. run_0058.dat.27-11-10_02h07m40s
Definition at line 297 of file KVDatime.cpp.
Decodes IRODS format date into a TDatime Format of date string is: 2008-12-19.15:21
Definition at line 241 of file KVDatime.cpp.
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 204 of file KVDatime.cpp.
Decodes SRB format date into a TDatime Format of date string is: 2008-12-19-15.21
Definition at line 221 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 401 of file KVDatime.cpp.
|
staticprivate |
list of months
Definition at line 33 of file KVDatime.h.
|
private |
internal buffer used by String method
Definition at line 36 of file KVDatime.h.
|
staticprivate |
counter
Definition at line 34 of file KVDatime.h.