tntdb::Date Class Reference

This class holds a date. More...

#include <date.h>

List of all members.

Public Member Functions

 Date ()
 Initializes the Date-object with empty values.
 Date (unsigned short year_, unsigned short month_, unsigned short day_)
 Initializes the date-object with the given values.
unsigned short getYear () const
 Returns the year-part of the Date.
unsigned short getMonth () const
 Returns the month-part of the Date.
unsigned short getDay () const
 Returns the day-part of the Date.
unsigned short getWDay () const
 Returns the day of week of the Date (0=sunday to 6=saturday).
bool isNull () const
void set (unsigned short year_, unsigned short month_, unsigned short day_)
 sets the date.
std::string getIso () const
 returns the date in ISO-format (yyyy-mm-dd)
bool operator== (const Date &dt) const
bool operator!= (const Date &dt) const
bool operator< (const Date &dt) const
bool operator> (const Date &dt) const
bool operator<= (const Date &dt) const
bool operator>= (const Date &dt) const

Static Public Member Functions

static Date localtime ()
static Date gmtime ()
static Date fromIso (const std::string &s)
 interprets the passed string as a date-string in ISO-format (yyyy-mm-dd) and returns a Date-object.


Detailed Description

This class holds a date.

Constructor & Destructor Documentation

tntdb::Date::Date (  )  [inline]

Initializes the Date-object with empty values.

tntdb::Date::Date ( unsigned short  year_,
unsigned short  month_,
unsigned short  day_ 
) [inline]

Initializes the date-object with the given values.

No range-checks are done.


Member Function Documentation

unsigned short tntdb::Date::getYear (  )  const [inline]

Returns the year-part of the Date.

unsigned short tntdb::Date::getMonth (  )  const [inline]

Returns the month-part of the Date.

unsigned short tntdb::Date::getDay (  )  const [inline]

Returns the day-part of the Date.

unsigned short tntdb::Date::getWDay (  )  const

Returns the day of week of the Date (0=sunday to 6=saturday).

void tntdb::Date::set ( unsigned short  year_,
unsigned short  month_,
unsigned short  day_ 
) [inline]

sets the date.

std::string tntdb::Date::getIso (  )  const

returns the date in ISO-format (yyyy-mm-dd)

static Date tntdb::Date::fromIso ( const std::string &  s  )  [static]

interprets the passed string as a date-string in ISO-format (yyyy-mm-dd) and returns a Date-object.

When the string is not in ISO-format, a exception of type tntdb::TypeError is thrown.


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

Generated on Mon Jun 16 14:08:46 2008 for tntdb by  doxygen 1.5.6