Auxililary class to get date and time.
More...
#include <JDate.hh>
Auxililary class to get date and time.
Definition at line 96 of file JSystem/JDate.hh.
JSYSTEM::JDateAndTime::JDateAndTime |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 100 of file JSystem/JDate.hh.
void set() const
Set to actual time.
JSYSTEM::JDateAndTime::JDateAndTime |
( |
const time_t |
t1 | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 111 of file JSystem/JDate.hh.
void set() const
Set to actual time.
tm* JSYSTEM::JDateAndTime::operator-> |
( |
| ) |
|
|
inline |
Smart pointer.
- Returns
- pointer to time structure
Definition at line 122 of file JSystem/JDate.hh.
const tm* JSYSTEM::JDateAndTime::operator-> |
( |
| ) |
const |
|
inline |
Smart pointer.
- Returns
- pointer to time structure
Definition at line 133 of file JSystem/JDate.hh.
int JSYSTEM::JDateAndTime::getSeconds |
( |
| ) |
const |
|
inline |
int JSYSTEM::JDateAndTime::getMinutes |
( |
| ) |
const |
|
inline |
int JSYSTEM::JDateAndTime::getHour |
( |
| ) |
const |
|
inline |
int JSYSTEM::JDateAndTime::getDay |
( |
| ) |
const |
|
inline |
int JSYSTEM::JDateAndTime::getMonth |
( |
| ) |
const |
|
inline |
int JSYSTEM::JDateAndTime::getYear |
( |
| ) |
const |
|
inline |
JSYSTEM::JDateAndTime::operator std::string |
( |
| ) |
const |
|
inline |
Type conversion operator.
- Returns
- ASCII formatted date and time
Definition at line 151 of file JSystem/JDate.hh.
std::string toString(const JDateAndTimeFormat option=HUMAN_READABLE) const
Get ASCII formatted date and time.
Get ASCII formatted date and time.
- Parameters
-
- Returns
- ASCII formatted date and time
Definition at line 163 of file JSystem/JDate.hh.
169 static const int MAX_SIZE = 256;
170 static char buffer[MAX_SIZE];
175 strftime(buffer, MAX_SIZE,
"%FT%T%z",
tp);
179 strftime(buffer, MAX_SIZE,
"%a %b %d %X %Z %Y",
tp);
188 buffer[MAX_SIZE-1] =
'\0';
190 return string(buffer);
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Human readable format (Www Mmm dd hh:mm:ss yyyy)
Exception for accessing a value in a collection that is outside of its range.
const JDateAndTime& JSYSTEM::JDateAndTime::operator() |
( |
| ) |
const |
|
inline |
Set date and time.
- Returns
- date and time
Definition at line 199 of file JSystem/JDate.hh.
void set() const
Set to actual time.
void JSYSTEM::JDateAndTime::set |
( |
| ) |
const |
|
inline |
void JSYSTEM::JDateAndTime::set |
( |
const time_t |
t1 | ) |
const |
|
inline |
double JSYSTEM::JDateAndTime::getElapsedTime |
( |
const JDateAndTime & |
object | ) |
const |
|
inline |
Get elapsed time since given date and time.
- Parameters
-
- Returns
- time [s]
Definition at line 236 of file JSystem/JDate.hh.
238 return difftime(this->
ts,
object.
ts);
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 249 of file JSystem/JDate.hh.
251 return out <<
object.toString();
time_t JSYSTEM::JDateAndTime::ts |
|
mutableprivate |
tm* JSYSTEM::JDateAndTime::tp |
|
mutableprivate |
The documentation for this struct was generated from the following file: