Auxililary class to get date and time.
More...
#include <JDate.hh>
Auxililary class to get date and time.
Definition at line 59 of file JDate.hh.
◆ JDateAndTime() [1/2]
JSYSTEM::JDateAndTime::JDateAndTime |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 63 of file JDate.hh.
◆ JDateAndTime() [2/2]
JSYSTEM::JDateAndTime::JDateAndTime |
( |
const time_t |
t1 | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 74 of file JDate.hh.
◆ operator->()
const tm* JSYSTEM::JDateAndTime::operator-> |
( |
| ) |
const |
|
inline |
Smart pointer.
- Returns
- pointer to time structure
Definition at line 85 of file JDate.hh.
◆ getSeconds()
int JSYSTEM::JDateAndTime::getSeconds |
( |
| ) |
const |
|
inline |
seconds after the minute [0-59]
Definition at line 91 of file JDate.hh.
◆ getMinutes()
int JSYSTEM::JDateAndTime::getMinutes |
( |
| ) |
const |
|
inline |
minutes after the hour [0-59]
Definition at line 92 of file JDate.hh.
◆ getHour()
int JSYSTEM::JDateAndTime::getHour |
( |
| ) |
const |
|
inline |
hours after midnight [0-23]
Definition at line 93 of file JDate.hh.
◆ getDay()
int JSYSTEM::JDateAndTime::getDay |
( |
| ) |
const |
|
inline |
day of the month [1-31]
Definition at line 94 of file JDate.hh.
◆ getMonth()
int JSYSTEM::JDateAndTime::getMonth |
( |
| ) |
const |
|
inline |
month of the year [1-12]
Definition at line 95 of file JDate.hh.
◆ getYear()
int JSYSTEM::JDateAndTime::getYear |
( |
| ) |
const |
|
inline |
◆ operator std::string()
JSYSTEM::JDateAndTime::operator std::string |
( |
| ) |
const |
|
inline |
Type conversion operator.
- Returns
- ASCII formatted date and time
Definition at line 104 of file JDate.hh.
◆ toString()
std::string JSYSTEM::JDateAndTime::toString |
( |
| ) |
const |
|
inline |
Get ASCII formatted date and time.
- Returns
- ASCII formatted date and time
Definition at line 115 of file JDate.hh.
117 const std::string buffer = ctime(&
ts);
121 return buffer.substr(0, buffer.length() - 1);
◆ operator()()
const JDateAndTime& JSYSTEM::JDateAndTime::operator() |
( |
| ) |
const |
|
inline |
Set date and time.
- Returns
- date and time
Definition at line 130 of file JDate.hh.
◆ set() [1/2]
void JSYSTEM::JDateAndTime::set |
( |
| ) |
const |
|
inline |
Set to actual time.
Definition at line 141 of file JDate.hh.
◆ set() [2/2]
void JSYSTEM::JDateAndTime::set |
( |
const time_t |
t1 | ) |
const |
|
inline |
Set to given time.
- Parameters
-
Definition at line 154 of file JDate.hh.
◆ getElapsedTime()
double JSYSTEM::JDateAndTime::getElapsedTime |
( |
const JDateAndTime & |
object | ) |
const |
|
inline |
Get elapsed time since given date and time.
- Parameters
-
- Returns
- time [s]
Definition at line 167 of file JDate.hh.
169 return difftime(this->
ts,
object.
ts);
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const JDateAndTime & |
object |
|
) |
| |
|
friend |
Write date and time to output.
- Parameters
-
out | output stream |
object | date and time |
- Returns
- output stream
Definition at line 180 of file JDate.hh.
182 return out <<
object.toString();
◆ ts
time_t JSYSTEM::JDateAndTime::ts |
|
mutableprivate |
◆ tp
tm* JSYSTEM::JDateAndTime::tp |
|
mutableprivate |
The documentation for this struct was generated from the following file: