#include <DateTime.h>
Public Member Functions | |
| virtual std::string | getFormattedLocal (const std::string &fmt) const =0 |
| virtual std::string | getFormattedUtc (const std::string &fmt) const =0 |
| virtual time_t | getStructured () const =0 |
| virtual double | getSecondsSince (const DateTime &other) const =0 |
| virtual void | setToCurrentTime ()=0 |
| virtual void | setStructured (time_t val)=0 |
| virtual bool | set (unsigned short year, unsigned short month, unsigned short day, unsigned short hour, unsigned short minute, unsigned short second)=0 |
| virtual bool | set (unsigned short year=2000, unsigned short month=01, unsigned short day=01)=0 |
| virtual bool | set (const std::string &fromTime)=0 |
| virtual bool | isTimeValid () const =0 |
| virtual bool | isValid () const =0 |
Protected Member Functions | |
| virtual | ~DateTime () |
Base class for date and time object, based upon the capability provided by the standard C library's <time.h>.
Definition at line 24 of file DateTime.h.
| virtual DateTime::~DateTime | ( | ) | [protected, virtual] |
This should be destroyed by calling ObjectFactory::destroyObject.
Definition at line 177 of file DateTime.h.
| virtual std::string DateTime::getFormattedLocal | ( | const std::string & | fmt | ) | const [pure virtual] |
Gets the time in local coordinates, formatted as a string.
| fmt | A format specification, consistent with that documented for strftime in <time.h> |
| virtual std::string DateTime::getFormattedUtc | ( | const std::string & | fmt | ) | const [pure virtual] |
Gets the time in UTC coordinates, formatted as a string.
| fmt | A format specification, consistent with that documented for strftime in <time.h> |
| virtual time_t DateTime::getStructured | ( | ) | const [pure virtual] |
Gets the time value as a value maniuplated by C.
| virtual double DateTime::getSecondsSince | ( | const DateTime & | other | ) | const [pure virtual] |
Gets the time elapsed between this object and the argument object.
| virtual void DateTime::setToCurrentTime | ( | ) | [pure virtual] |
Resets this object to have the current operating system date and time.
| virtual void DateTime::setStructured | ( | time_t | val | ) | [pure virtual] |
Sets the time value as a value manipulated by C.
| val | The time_t value that can be passed to traditional C runtime library functions. |
| virtual bool DateTime::set | ( | unsigned short | year, | |
| unsigned short | month, | |||
| unsigned short | day, | |||
| unsigned short | hour, | |||
| unsigned short | minute, | |||
| unsigned short | second | |||
| ) | [pure virtual] |
Sets the date and time to explicit client values.
| year | The four-digit year. Note that years greater than 2047 or less than 1900 are problematical with C. | |
| month | Starting from 1 for January, up to 12 for December. | |
| day | The day within the month, starting from 1. | |
| hour | The hour within the day, from 0 up to 23. | |
| minute | The minute within the hour, from 0 to 59. | |
| second | The seconds within the minute, from 0 to 59. |
| virtual bool DateTime::set | ( | unsigned short | year = 2000, |
|
| unsigned short | month = 01, |
|||
| unsigned short | day = 01 | |||
| ) | [pure virtual] |
Sets the date and time to explicit client values.
| year | The four-digit year. Note that years greater than 2047 or less than 1900 are problematical with C. | |
| month | Starting from 1 for January, up to 12 for December. | |
| day | The day within the month, starting from 1. |
| virtual bool DateTime::set | ( | const std::string & | fromTime | ) | [pure virtual] |
Set the date and time from a specially formatted string.
| fromTime | A string in a sub-set of ISO8601 format. No validation is performed on this string. This function will also accept strings that omit the time information, ie. from the 'T' onward. The lexical description is: yyyy '-' mm '-' dd 'T' hh ':' MM ':' ss 'Z' where: strings in '' are literal characters yyyy is a four-or-more digit numeral representing the year. 0000 is not valid and this function does not accept negative years even though they are part of ISO8601 mm is a two-digit numeral representing the month dd is a two-digit numeral representing the day hh is a two-digit numeral representing the hour. 24 is permitted if hours and minutes are 00 and 00 MM is a two-digit numeral representing the minute ss is a two-digit numeral representing the whole second |
| virtual bool DateTime::isTimeValid | ( | ) | const [pure virtual] |
| virtual bool DateTime::isValid | ( | ) | const [pure virtual] |