libodbc++
0.2.5
|
An SQL TIMESTAMP. More...
#include <types.h>
Public Member Functions | |
Timestamp (int year, int month, int day, int hour, int minute, int second, int nanos=0) | |
Constructor. | |
Timestamp () | |
Constructor. | |
Timestamp (std::time_t t) | |
Constructor. | |
Timestamp (const std::string &s) | |
Constructor. | |
Timestamp (const Timestamp &t) | |
Copy constructor. | |
Timestamp & | operator= (const Timestamp &t) |
Assignment operator. | |
virtual | ~Timestamp () |
Destructor. | |
virtual void | setTime (std::time_t t) |
Sets this timestamp to the specified time_t value. | |
virtual std::time_t | getTime () const |
Gets the time_t value of this timestamp. | |
void | parse (const std::string &s) |
Set this timestamp from a YYYY-MM-DD HH:MM:SS[.NNN...] format. | |
int | getNanos () const |
Gets the nanoseconds value of this timestamp. | |
void | setNanos (int nanos) |
Sets the nanoseconds value of this timestamp. | |
virtual std::string | toString () const |
Gets the date as a string in the YYYY-MM-DD format. | |
![]() | |
Date (int year, int month, int day) | |
Constructor. | |
Date () | |
Constructor. | |
Date (std::time_t t) | |
Constructor. | |
Date (const std::string &str) | |
Constructor. | |
Date (const Date &d) | |
Copy constructor. | |
Date & | operator= (const Date &d) |
Assignment operator. | |
virtual | ~Date () |
Destructor. | |
std::time_t | getTime () const |
Returns the time_t value of 00:00:00 at this date. | |
void | parse (const std::string &str) |
Sets this date from a string in the YYYY-MM-DD format. | |
int | getYear () const |
Gets the year of this date. | |
int | getMonth () const |
Gets the month of this date. | |
int | getDay () const |
Gets the monthday of this date. | |
void | setYear (int year) |
Sets the year of this date. | |
void | setMonth (int month) |
Sets the month of this date. | |
void | setDay (int day) |
Sets the day of this date. | |
![]() | |
Time (int hour, int minute, int second) | |
Constructor. | |
Time () | |
Constructor. | |
Time (std::time_t t) | |
Constructor. | |
Time (const std::string &str) | |
Constructor. | |
Time (const Time &t) | |
Copy constructor. | |
Time & | operator= (const Time &t) |
Assignment operator. | |
virtual | ~Time () |
Destructor. | |
std::time_t | getTime () const |
Returns the time_t value of 1970-01-01 at this time. | |
void | parse (const std::string &str) |
Sets this time from a string in the HH:MM:SS format. | |
int | getHour () const |
Gets the hour of this time. | |
int | getMinute () const |
Gets the minute of this time. | |
int | getSecond () const |
Gets the second of this time. | |
void | setHour (int h) |
Sets the hour of this time. | |
void | setMinute (int m) |
Sets the minute of this time. | |
void | setSecond (int s) |
Sets the second of this time. | |
An SQL TIMESTAMP.
|
explicit |
Constructor.
Sets the timestamp to now.
odbc::Timestamp::Timestamp | ( | std::time_t | t | ) |
Constructor.
Sets this timestamp to the specified time_t
value.
odbc::Timestamp::Timestamp | ( | const std::string & | s | ) |
Constructor.
Sets this timestamp from a YYYY-MM-DD HH:MM:SS[.NNN...]
format