Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members

# mysqlpp::DateTime Struct Reference

A combination of the Date and Time classes for holding MySQL DateTimes. More...

`#include <datetime.h>`

Inheritance diagram for mysqlpp::DateTime:

[legend]
Collaboration diagram for mysqlpp::DateTime:

[legend]
List of all members.

## Public Methods
| DateTime ()
| Default constructor.
| DateTime (cchar *str)
| Initialize object from a MySQL date-and-time string.
| DateTime (const ColData &str)
| Initialize object from a MySQL date-and-time string.
| DateTime (const std::string &str)
| Initialize object from a MySQL date-and-time string.
short int | compare (const DateTime &other) const
| Compare this datetime to another.
std::ostream & | out_stream (std::ostream &os) const
| Insert the date and time into a stream.
cchar * | convert (cchar *)
| Parse a MySQL date and time string into this object.

## Detailed Description

A combination of the Date and Time classes for holding MySQL DateTimes.

Objects of this class can be inserted into streams, and initialized from MySQL DATETIME strings.

## Constructor & Destructor Documentation

mysqlpp::DateTime::DateTime | ( | cchar * | str | ) | `[inline]`

| Initialize object from a MySQL date-and-time string. String must be in the HH:MM:SS format. It doesn't have to be zero-padded.

mysqlpp::DateTime::DateTime | ( | const ColData & | str | ) | `[inline]`

| Initialize object from a MySQL date-and-time string. See also: DateTime(cchar*)

mysqlpp::DateTime::DateTime | ( | const std::string & | str | ) | `[inline]`

| Initialize object from a MySQL date-and-time string. See also: DateTime(cchar*)

## Member Function Documentation

short int mysqlpp::DateTime::compare | ( | const DateTime & | other | ) | const`[virtual]`

| Compare this datetime to another. Returns < 0 if this datetime is before the other, 0 of they are equal, and > 0 if this datetime is after the other. This method is protected because it is merely the engine used by the various operators in DTbase. Implements mysqlpp::DTbase< DateTime >.

ostream & mysqlpp::DateTime::out_stream | ( | std::ostream & | os | ) | const

  | Insert the date and time into a stream. The date and time are inserted into the stream, in that order, with a space between them. Parameters:
  os | stream to insert date and time into
Reimplemented from mysqlpp::mysql_date.

The documentation for this struct was generated from the following files:

- datetime.h
- datetime.cpp