libodbc++  0.2.5
Public Member Functions | List of all members
odbc::Timestamp Class Reference

An SQL TIMESTAMP. More...

#include <types.h>

Inheritance diagram for odbc::Timestamp:
odbc::Date odbc::Time

Public Member Functions

 Timestamp (int year, int month, int day, int hour, int minute, int second, int nanos=0)
 Constructor.
 
 Timestamp ()
 Constructor. More...
 
 Timestamp (std::time_t t)
 Constructor. More...
 
 Timestamp (const std::string &s)
 Constructor. More...
 
 Timestamp (const Timestamp &t)
 Copy constructor.
 
Timestampoperator= (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.
 
- Public Member Functions inherited from odbc::Date
 Date (int year, int month, int day)
 Constructor.
 
 Date ()
 Constructor. More...
 
 Date (std::time_t t)
 Constructor. More...
 
 Date (const std::string &str)
 Constructor. More...
 
 Date (const Date &d)
 Copy constructor.
 
Dateoperator= (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.
 
- Public Member Functions inherited from odbc::Time
 Time (int hour, int minute, int second)
 Constructor.
 
 Time ()
 Constructor. More...
 
 Time (std::time_t t)
 Constructor. More...
 
 Time (const std::string &str)
 Constructor. More...
 
 Time (const Time &t)
 Copy constructor.
 
Timeoperator= (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.
 

Detailed Description

An SQL TIMESTAMP.

Constructor & Destructor Documentation

odbc::Timestamp::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


The documentation for this class was generated from the following file:

Go back to the libodbc++ homepage