This class represents a date and time with an accuracy of one second.
More...
#include <utils.h>
List of all members.
Detailed Description
This class represents a date and time with an accuracy of one second.
Definition at line 1538 of file utils.h.
Constructor & Destructor Documentation
frepple::utils::Date::Date |
( |
const time_t |
l | ) |
[inline] |
Constructor initialized with a long value.
Definition at line 1605 of file utils.h.
frepple::utils::Date::Date |
( |
| ) |
[inline] |
Default constructor.
Definition at line 1610 of file utils.h.
frepple::utils::Date::Date |
( |
const char * |
s | ) |
[inline] |
Constructor initialized with a string. The string needs to be in the format specified by the "format".
Definition at line 1617 of file utils.h.
frepple::utils::Date::Date |
( |
int |
year, |
|
|
int |
month, |
|
|
int |
day, |
|
|
int |
hr = 0 , |
|
|
int |
min = 0 , |
|
|
int |
sec = 0 |
|
) |
| |
Constructor with year, month and day as arguments. Hours, minutes and seconds can optionally be passed too.
Definition at line 227 of file date.cpp.
Member Function Documentation
static string frepple::utils::Date::getFormat |
( |
| ) |
[inline, static] |
Retrieves the default date format.
Definition at line 1719 of file utils.h.
long frepple::utils::Date::getSecondsDay |
( |
| ) |
const [inline] |
Return the number of seconds since the start of the day.
Definition at line 1762 of file utils.h.
long frepple::utils::Date::getSecondsMonth |
( |
| ) |
const [inline] |
Return the number of seconds since the start of the month.
Definition at line 1742 of file utils.h.
long frepple::utils::Date::getSecondsWeek |
( |
| ) |
const [inline] |
Return the number of seconds since the start of the week. The week is starting on Sunday.
Definition at line 1752 of file utils.h.
long frepple::utils::Date::getSecondsYear |
( |
| ) |
const [inline] |
Return the number of seconds since january 1st.
Definition at line 1734 of file utils.h.
time_t frepple::utils::Date::getTicks |
( |
| ) |
const [inline] |
Return the seconds since the epoch, which is also the internal representation of a date.
Definition at line 1710 of file utils.h.
static Date frepple::utils::Date::now |
( |
| ) |
[inline, static] |
Static function returns a date object initialized with the current Date and time.
Definition at line 1684 of file utils.h.
frepple::utils::Date::operator bool |
( |
| ) |
const [inline] |
Check whether the date has been initialized.
Definition at line 1680 of file utils.h.
frepple::utils::Date::operator string |
( |
| ) |
const [inline] |
Converts the date to a string. The format can be controlled by the setFormat() function.
Definition at line 1688 of file utils.h.
bool frepple::utils::Date::operator! |
( |
| ) |
const [inline] |
Check whether the date has been initialized.
Definition at line 1677 of file utils.h.
bool frepple::utils::Date::operator!= |
( |
const Date & |
b | ) |
const [inline] |
Inequality of dates.
Definition at line 1636 of file utils.h.
Date frepple::utils::Date::operator+ |
( |
const TimePeriod & |
l | ) |
const [inline] |
Adding a time to a date returns a new date.
Definition at line 1656 of file utils.h.
void frepple::utils::Date::operator+= |
( |
const TimePeriod & |
l | ) |
[inline] |
Adds some time to this date.
Definition at line 1648 of file utils.h.
Date frepple::utils::Date::operator- |
( |
const TimePeriod & |
l | ) |
const [inline] |
Subtracting a time from a date returns a new date.
Definition at line 1664 of file utils.h.
TimePeriod frepple::utils::Date::operator- |
( |
const Date & |
l | ) |
const [inline] |
Subtracting two date values returns the time difference in a TimePeriod object.
Definition at line 1673 of file utils.h.
void frepple::utils::Date::operator-= |
( |
const TimePeriod & |
l | ) |
[inline] |
Subtracts some time to this date.
Definition at line 1652 of file utils.h.
bool frepple::utils::Date::operator< |
( |
const Date & |
b | ) |
const [inline] |
Comparison between dates.
Definition at line 1627 of file utils.h.
bool frepple::utils::Date::operator<= |
( |
const Date & |
b | ) |
const [inline] |
Comparison between dates.
Definition at line 1642 of file utils.h.
void frepple::utils::Date::operator= |
( |
const Date & |
b | ) |
[inline] |
Assignment operator.
Definition at line 1645 of file utils.h.
bool frepple::utils::Date::operator== |
( |
const Date & |
b | ) |
const [inline] |
Equality of dates.
Definition at line 1633 of file utils.h.
bool frepple::utils::Date::operator> |
( |
const Date & |
b | ) |
const [inline] |
Comparison between dates.
Definition at line 1630 of file utils.h.
bool frepple::utils::Date::operator>= |
( |
const Date & |
b | ) |
const [inline] |
Comparison between dates.
Definition at line 1639 of file utils.h.
void frepple::utils::Date::parse |
( |
const char * |
s, |
|
|
const string & |
fmt = format |
|
) |
| |
Function that parses a string according to the format string.
Definition at line 210 of file date.cpp.
static void frepple::utils::Date::setFormat |
( |
const string & |
n | ) |
[inline, static] |
Updates the default date format.
Definition at line 1716 of file utils.h.
size_t frepple::utils::Date::toCharBuffer |
( |
char * |
str | ) |
const [inline] |
This function fills a character buffer with a text representation of the date.
The character buffer passed is expected to have room for at least 30 characters. 30 characters should be sufficient for even the most funky date format.
Definition at line 1701 of file utils.h.
Friends And Related Function Documentation
ostream& operator<< |
( |
ostream & |
os, |
|
|
const Date & |
d |
|
) |
| [friend] |
Prints a date to the outputstream.
Definition at line 1779 of file utils.h.
Member Data Documentation
A constant representing the infinite future, i.e. the latest time which we can represent.
This value is currently set to 2030-12-31T00:00:00.
Definition at line 1731 of file utils.h.
A constant representing the infinite past, i.e. the earliest time which we can represent.
This value is normally 1971-01-01T00:00:00.
Definition at line 1725 of file utils.h.
The documentation for this class was generated from the following files: