#include <datetime.h>
Inheritance diagram for mysqlpp::Time:
Public Member Functions | |
Time () | |
Default constructor. | |
Time (unsigned char h, unsigned char m, unsigned char s) | |
Initialize object. | |
Time (const Time &other) | |
Initialize object as a copy of another Time. | |
Time (const DateTime &other) | |
Initialize object from time part of date/time object. | |
Time (const char *str) | |
Initialize object from a C string containing a SQL time string. | |
template<class Str> | |
Time (const Str &str) | |
Initialize object from a C++ string containing a SQL time string. | |
Time (time_t t) | |
Initialize object from a time_t . | |
int | compare (const Time &other) const |
Compare this time to another. | |
const char * | convert (const char *) |
Parse a SQL time string into this object. | |
unsigned char | hour () const |
Get the time's hour part, 0-23. | |
void | hour (unsigned char h) |
Change the time's hour part, 0-23. | |
unsigned char | minute () const |
Get the time's minute part, 0-59. | |
void | minute (unsigned char m) |
Change the time's minute part, 0-59. | |
operator std::string () const | |
Convert to std::string. | |
operator time_t () const | |
Convert to time_t. | |
unsigned char | second () const |
Get the time's second part, 0-59. | |
void | second (unsigned char s) |
Change the time's second part, 0-59. | |
std::string | str () const |
Return our value in std::string form. |
Objects of this class can be inserted into streams, and initialized from SQL TIME strings.
|
Initialize object from a C string containing a SQL time string. String must be in the HH:MM:SS format. It doesn't have to be zero-padded. |
|
Initialize object from a C++ string containing a SQL time string. This works with any stringish class that declares a c_str() member function: std::string, mysqlpp::String...
|
|
Initialize object from a
Naturally, we throw away the "date" part of the |
|
Compare this time to another. Returns < 0 if this time is before the other, 0 of they are equal, and > 0 if this time is after the other. Implements Comparable< Time >. |
|
Convert to time_t.
The "date" part of the |