Jpp 19.3.0-rc.2
the software that should make you happy
|
Auxiliary class for date and time. More...
#include <JDateAndTime.hh>
Public Member Functions | |
JDateAndTime (const bool utc=false) | |
Constructor. | |
JDateAndTime (const time_t t1, const bool utc=false) | |
Constructor. | |
JDateAndTime (const time_t t1, const float f1, const bool utc=false) | |
Constructor. | |
JDateAndTime (const std::string &buffer) | |
Constructor. | |
bool | less (const JDateAndTime &object) const |
Less than method. | |
const tm * | operator-> () const |
Smart pointer. | |
bool | isUTC () const |
Check if UTC time. | |
time_t | getTime () const |
time | |
int | getSeconds () const |
seconds after the minute [0-59] | |
int | getMinutes () const |
minutes after the hour [0-59] | |
int | getHour () const |
hours after midnight [0-23] | |
int | getDay () const |
day of the month [1-31] | |
int | getMonth () const |
month of the year [1-12] | |
int | getYear () const |
year a.d. | |
int | getDST () const |
daylight saving time | |
float | getFS () const |
fraction of second | |
operator std::string () const | |
Type conversion operator. | |
std::string | toString () const |
Get ASCII formatted date and time. | |
const JDateAndTime & | operator() () |
Set date and time. | |
void | set (const bool utc=false) |
Set to current local time. | |
void | set (const time_t t1, const bool utc=false) |
Set to given time. | |
void | set (const time_t t1, const float f1, const bool utc=false) |
Set to given time. | |
void | add (const time_t t1) |
Add given time. | |
void | sub (const time_t t1) |
Subtract given time. | |
double | getElapsedTime (const JDateAndTime &object) const |
Get elapsed time to given date and time. | |
Static Public Member Functions | |
static bool | isISO8601 (const std::string &buffer) |
Function to check ISO-8601 conformity. | |
Private Member Functions | |
tm * | get () const |
Get representation. | |
Private Attributes | |
time_t | ts |
value | |
float | fs = 0.0 |
fraction of second | |
tm * | tp |
representation | |
bool | utc = false |
UTC. | |
Friends | |
std::istream & | operator>> (std::istream &in, JDateAndTime &object) |
Read date and time from input stream. | |
std::ostream & | operator<< (std::ostream &out, const JDateAndTime &object) |
Write date and time to output stream. | |
Auxiliary class for date and time.
The data structure time_t
is used for the internal value and the data structure tm
for the representation.
The I/O format conforms with ISO-8601 standard but it is also possible to parse ROOT TTimeStamp::AsString("c")
.
Definition at line 78 of file JDateAndTime.hh.
|
inline |
Constructor.
utc | UTC |
Definition at line 86 of file JDateAndTime.hh.
|
inline |
|
inline |
Constructor.
t1 | time [s] |
f1 | fraction of seconds |
utc | UTC |
Definition at line 111 of file JDateAndTime.hh.
|
inline |
Constructor.
buffer | date and time |
Definition at line 122 of file JDateAndTime.hh.
|
inline |
Less than method.
object | date and time |
Definition at line 136 of file JDateAndTime.hh.
|
inline |
Smart pointer.
Definition at line 147 of file JDateAndTime.hh.
|
inline |
Check if UTC time.
Definition at line 158 of file JDateAndTime.hh.
|
inline |
time
Definition at line 164 of file JDateAndTime.hh.
|
inline |
seconds after the minute [0-59]
Definition at line 166 of file JDateAndTime.hh.
|
inline |
minutes after the hour [0-59]
Definition at line 167 of file JDateAndTime.hh.
|
inline |
hours after midnight [0-23]
Definition at line 168 of file JDateAndTime.hh.
|
inline |
day of the month [1-31]
Definition at line 169 of file JDateAndTime.hh.
|
inline |
month of the year [1-12]
Definition at line 170 of file JDateAndTime.hh.
|
inline |
year a.d.
Definition at line 171 of file JDateAndTime.hh.
|
inline |
daylight saving time
Definition at line 172 of file JDateAndTime.hh.
|
inline |
fraction of second
Definition at line 174 of file JDateAndTime.hh.
|
inline |
Type conversion operator.
Definition at line 182 of file JDateAndTime.hh.
|
inlinestatic |
Function to check ISO-8601 conformity.
buffer | date and time |
Definition at line 194 of file JDateAndTime.hh.
|
inline |
Get ASCII formatted date and time.
Definition at line 215 of file JDateAndTime.hh.
|
inline |
|
inline |
|
inline |
Set to given time.
t1 | time [s] |
utc | UTC |
Definition at line 262 of file JDateAndTime.hh.
|
inline |
Set to given time.
t1 | time [s] |
f1 | fraction of seconds |
utc | UTC |
Definition at line 276 of file JDateAndTime.hh.
|
inline |
|
inline |
|
inline |
Get elapsed time to given date and time.
object | date and time |
Definition at line 312 of file JDateAndTime.hh.
|
inlineprivate |
|
friend |
Read date and time from input stream.
in | input stream |
object | date and time |
Definition at line 325 of file JDateAndTime.hh.
|
friend |
Write date and time to output stream.
out | output stream |
object | date and time |
Definition at line 442 of file JDateAndTime.hh.
|
private |
value
Definition at line 458 of file JDateAndTime.hh.
|
private |
fraction of second
Definition at line 459 of file JDateAndTime.hh.
|
mutableprivate |
representation
Definition at line 460 of file JDateAndTime.hh.
|
private |
UTC.
Definition at line 461 of file JDateAndTime.hh.