This class holds a time. More...

#include <tntdb/time.h>

Public Member Functions

 Time ()
 Create a Time object with empty values.
 Time (unsigned short hour, unsigned short minute, unsigned short second, unsigned short millis=0)
 Create a Time object with the given values.
unsigned short getHour () const
 Get the hour part of the Time.
unsigned short getMinute () const
 Get the minute part of the Time.
unsigned short getSecond () const
 Get the second part of the Time.
unsigned short getMillis () const
 Get the millisecond part of the Time.
bool isNull () const
void set (unsigned short hour, unsigned short minute, unsigned short second, unsigned short millis=0)
 Sets the time.
std::string getIso () const
 Get 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 localtime ()
static Time gmtime ()
static Time fromIso (const std::string &s)
 Construct a Time object from the given ISO date string.

Detailed Description

This class holds a time.

Constructor & Destructor Documentation

tntdb::Time::Time ( )
inline

Create a Time object with empty values.

tntdb::Time::Time ( unsigned short  hour,
unsigned short  minute,
unsigned short  second,
unsigned short  millis = 0 
)
inline

Create a Time object with the given values.

No range checks are done.

Member Function Documentation

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

Construct a Time object from the given ISO date string.

If the string is not in ISO format, an exception of type tntdb::TypeError is thrown.

unsigned short tntdb::Time::getHour ( ) const
inline

Get the hour part of the Time.

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

Get the time in ISO format (hh:mm:ss.hhh)

unsigned short tntdb::Time::getMillis ( ) const
inline

Get the millisecond part of the Time.

unsigned short tntdb::Time::getMinute ( ) const
inline

Get the minute part of the Time.

unsigned short tntdb::Time::getSecond ( ) const
inline

Get the second part of the Time.

static Time tntdb::Time::gmtime ( )
static
bool tntdb::Time::isNull ( ) const
inline
static Time tntdb::Time::localtime ( )
static
bool tntdb::Time::operator!= ( const Time dt) const
inline
bool tntdb::Time::operator< ( const Time dt) const
inline
bool tntdb::Time::operator<= ( const Time dt) const
inline
bool tntdb::Time::operator== ( const Time dt) const
inline
bool tntdb::Time::operator> ( const Time dt) const
inline
bool tntdb::Time::operator>= ( const Time dt) const
inline
void tntdb::Time::set ( unsigned short  hour,
unsigned short  minute,
unsigned short  second,
unsigned short  millis = 0 
)
inline

Sets the time.

No range checks are done


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