Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

Date Class Reference

#include <tntdb/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_)
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)


Detailed Description

This class holds a date.

Constructor & Destructor Documentation

Date ( unsigned short  year_,
unsigned short  month_,
unsigned short  day_ 
)

Initializes the date-object with the given values. No range-checks are done.


Member Function Documentation

static 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.

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6