GNU CommonC++
Public Member Functions | List of all members
ost::Datetime Class Reference

The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time. More...

#include <numbers.h>

Inheritance diagram for ost::Datetime:
ost::Date ost::Time

Public Member Functions

 Datetime (time_t tm)
 
 Datetime (tm *dt)
 
 Datetime (const char *str, size_t size=0)
 
 Datetime (int year, unsigned month, unsigned day, int hour, int minute, int second)
 
 Datetime ()
 
virtual ~Datetime ()
 
char * getDatetime (char *buffer) const
 
time_t getDatetime (void) const
 
bool isValid (void) const
 
Datetimeoperator= (const Datetime datetime)
 
Datetimeoperator+= (const Datetime &datetime)
 
Datetimeoperator-= (const Datetime &datetime)
 
Datetimeoperator+= (const Time &time)
 
Datetimeoperator-= (const Time &time)
 
int operator== (const Datetime &)
 
int operator!= (const Datetime &)
 
int operator< (const Datetime &)
 
int operator<= (const Datetime &)
 
int operator> (const Datetime &)
 
int operator>= (const Datetime &)
 
bool operator! () const
 
String strftime (const char *format) const
 
- Public Member Functions inherited from ost::Date
 Date (time_t tm)
 
 Date (tm *dt)
 
 Date (char *str, size_t size=0)
 
 Date (int year, unsigned month, unsigned day)
 
 Date ()
 
virtual ~Date ()
 
int getYear (void) const
 
unsigned getMonth (void) const
 
unsigned getDay (void) const
 
unsigned getDayOfWeek (void) const
 
char * getDate (char *buffer) const
 
time_t getDate (void) const
 
time_t getDate (tm *buf) const
 
long getValue (void) const
 
void setDate (const char *str, size_t size=0)
 
bool isValid (void) const
 
 operator long () const
 
String operator() () const
 
Dateoperator++ ()
 
Dateoperator-- ()
 
Dateoperator+= (const long val)
 
Dateoperator-= (const long val)
 
int operator== (const Date &date)
 
int operator!= (const Date &date)
 
int operator< (const Date &date)
 
int operator<= (const Date &date)
 
int operator> (const Date &date)
 
int operator>= (const Date &date)
 
bool operator! () const
 
- Public Member Functions inherited from ost::Time
 Time (time_t tm)
 
 Time (tm *dt)
 
 Time (char *str, size_t size=0)
 
 Time (int hour, int minute, int second)
 
 Time ()
 
virtual ~Time ()
 
long getValue (void) const
 
int getHour (void) const
 
int getMinute (void) const
 
int getSecond (void) const
 
char * getTime (char *buffer) const
 
time_t getTime (void) const
 
tm * getTime (tm *buf) const
 
void setTime (char *str, size_t size=0)
 
bool isValid (void) const
 
 operator long ()
 
String operator() () const
 
Timeoperator++ ()
 
Timeoperator-- ()
 
Timeoperator+= (const int val)
 
Timeoperator-= (const int val)
 
int operator== (const Time &time)
 
int operator!= (const Time &time)
 
int operator< (const Time &time)
 
int operator<= (const Time &time)
 
int operator> (const Time &time)
 
int operator>= (const Time &time)
 
bool operator! () const
 

Additional Inherited Members

- Protected Member Functions inherited from ost::Date
void toJulian (long year, long month, long day)
 
void fromJulian (char *buf) const
 
virtual void update (void)
 A method to use to "post" any changed values when shadowing a mixed object class.
 
- Protected Member Functions inherited from ost::Time
void toSeconds (int hour, int minute, int second)
 
void fromSeconds (char *buf) const
 
virtual void update (void)
 
- Protected Attributes inherited from ost::Date
long julian
 
- Protected Attributes inherited from ost::Time
long seconds
 

Detailed Description

The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time.

This is then manipulated in several forms and may be exported as needed.

Author
Marcelo Dalmas mad@b.nosp@m.rasm.nosp@m.ap.co.nosp@m.m.br

Integer based time class.

Constructor & Destructor Documentation

◆ Datetime() [1/5]

ost::Datetime::Datetime ( time_t  tm)

◆ Datetime() [2/5]

ost::Datetime::Datetime ( tm *  dt)

◆ Datetime() [3/5]

ost::Datetime::Datetime ( const char *  str,
size_t  size = 0 
)

◆ Datetime() [4/5]

ost::Datetime::Datetime ( int  year,
unsigned  month,
unsigned  day,
int  hour,
int  minute,
int  second 
)

◆ Datetime() [5/5]

ost::Datetime::Datetime ( )

◆ ~Datetime()

virtual ost::Datetime::~Datetime ( )
virtual

Member Function Documentation

◆ getDatetime() [1/2]

char * ost::Datetime::getDatetime ( char *  buffer) const

◆ getDatetime() [2/2]

time_t ost::Datetime::getDatetime ( void  ) const

◆ isValid()

bool ost::Datetime::isValid ( void  ) const

◆ operator!()

bool ost::Datetime::operator! ( ) const

◆ operator!=()

int ost::Datetime::operator!= ( const Datetime )

◆ operator+=() [1/2]

Datetime & ost::Datetime::operator+= ( const Datetime datetime)

◆ operator+=() [2/2]

Datetime & ost::Datetime::operator+= ( const Time time)

◆ operator-=() [1/2]

Datetime & ost::Datetime::operator-= ( const Datetime datetime)

◆ operator-=() [2/2]

Datetime & ost::Datetime::operator-= ( const Time time)

◆ operator<()

int ost::Datetime::operator< ( const Datetime )

◆ operator<=()

int ost::Datetime::operator<= ( const Datetime )

◆ operator=()

Datetime & ost::Datetime::operator= ( const Datetime  datetime)

◆ operator==()

int ost::Datetime::operator== ( const Datetime )

◆ operator>()

int ost::Datetime::operator> ( const Datetime )

◆ operator>=()

int ost::Datetime::operator>= ( const Datetime )

◆ strftime()

String ost::Datetime::strftime ( const char *  format) const

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