21 #ifndef ASAP_OPERATORS_H 22 #define ASAP_OPERATORS_H 35 template<u
int64_t convert>
49 template<u
int64_t convert>
89 template<u
int64_t c1, u
int64_t c2>
103 template<u
int64_t conv>
118 template<u
int64_t c1, u
int64_t c2>
131 template<u
int64_t c1>
176 template<
typename ostream>
178 return os << dt.
str(), os;
190 template<
typename ostream, u
int64_t convert>
191 inline static ostream & operator<<(ostream & os, const duration<convert> & du) {
192 return os << du.str(), os;
196 #endif //ASAP_OPERATORS_H static bool operator==(const asap::datetime &a, const asap::datetime &b)
Compares if a == b is true for two asap::datetime instances.
static bool operator>(const asap::datetime &a, const asap::datetime &b)
Compares if a > b is true for two asap::datetime instances.
static asap::datetime operator-(const asap::datetime &a, const duration< convert > &b)
Subtracts a duration from a datetime.
static bool operator<(const asap::datetime &a, const asap::datetime &b)
Compares if a < b is true for two asap::datetime instances.
std::string str(const std::string &fmt="%x %X") const
Converts to an string using the format specified.
The asap::datetime class exposes methods to create, manipulate and print dates.
The asap::duration class exposes methods to create, manipulate and print durations.
time_t timestamp() const
Converts an asap::datetime to a time_t
static asap::datetime operator+(const asap::datetime &a, const duration< convert > &b)
Adds a duration to a datetime.
static ostream & operator<<(ostream &os, const asap::datetime &dt)
Inserts a datetime into an standard output stream.