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

Time Class Reference

#include <tntdb/time.h>

List of all members.

Public Member Functions

 Time ()
 Initializes the Time-object with empty values.
 Time (unsigned short hour_, unsigned short minute_, unsigned short second_, unsigned short millis_=0)
unsigned short getHour () const
 Returns the hour-part of the Time.
unsigned short getMinute () const
 Returns the minute-part of the Time.
unsigned short getSecond () const
 Returns the second-part of the Time.
unsigned short getMillis () const
 Returns the millisecond-part of the Time.
bool isNull () const
void set (unsigned short hour_, unsigned short minute_, unsigned short second_, unsigned short millis_=0)
std::string getIso () const
 Returns the time in ISO-format (hh:mm:ss.hhh).
bool operator== (const Time &dt) const
bool operator!= (const Time &dt) const
bool operator< (const Time &dt) const
bool operator> (const Time &dt) const
bool operator<= (const Time &dt) const
bool operator>= (const Time &dt) const

Static Public Member Functions

static Time fromIso (const std::string &s)


Detailed Description

This class holds a time.


Constructor & Destructor Documentation

Time ( unsigned short  hour_,
unsigned short  minute_,
unsigned short  second_,
unsigned short  millis_ = 0 
)

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


Member Function Documentation

void set ( unsigned short  hour_,
unsigned short  minute_,
unsigned short  second_,
unsigned short  millis_ = 0 
)

Sets the time. No range-checks are done.

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

Interprets the passed string as a time-string in ISO-format (hh:mm:ss.hhh) and returns a Time-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