The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time.
More...
|
| DateTime (const time_t time) |
| Construct a date and time from C library time_t type. More...
|
|
| DateTime (const tm_t *tm) |
| Construct a date and time from C library time structure. More...
|
|
| DateTime (const char *pointer, size_t size=0) |
| Construct a date and time from ISO string buffer. More...
|
|
| DateTime (int year, unsigned month, unsigned day, int hour=0, int minute=0, int second=0) |
| Construct a date and time object from explicit date and time values. More...
|
|
| DateTime (const DateTime &object) |
| Create a datetime object from another object. More...
|
|
| DateTime () |
| Construct a new date and time object with current date and time.
|
|
stringref_t | format (const char *strftime) const |
| Return date and time formatted using strftime format values. More...
|
|
time_t | get (void) const |
| Get C library time_t type if object in C library epoch range. More...
|
|
bool | is_valid (void) const |
| Test if object is valid. More...
|
|
| operator bool () const |
| Test is date and time is valid for is() operator. More...
|
|
| operator double () const |
| Convert date and time to julian day number. More...
|
|
| operator long () const |
| Casting operator to return date as number. More...
|
|
bool | operator! () const |
| Check if date and time is not valid. More...
|
|
bool | operator!= (const DateTime &datetime) const |
| Compare date and time with another date and time to see if not same. More...
|
|
const DateTime | operator+ (long seconds) const |
| Add seconds to datetime in an expression. More...
|
|
DateTime & | operator++ () |
| Add a day from the current date and time. More...
|
|
DateTime & | operator+= (long seconds) |
| Add seconds to the current datetime object. More...
|
|
long | operator- (const DateTime &datetime) |
| Operator to compute number of days between two dates. More...
|
|
const DateTime | operator- (long seconds) const |
| Subtract seconds from datetime in an expression. More...
|
|
DateTime & | operator-- () |
| Subtract a day from the current date and time. More...
|
|
DateTime & | operator-= (long seconds) |
| Subtract seconds from current datetime object. More...
|
|
bool | operator< (const DateTime &datetime) const |
| Compare date and time with another date and time to see if earlier. More...
|
|
bool | operator<= (const DateTime &datetime) const |
| Compare date and time with another date and time to see if earlier or the same. More...
|
|
DateTime & | operator= (const DateTime &datetime) |
| Assign date and time from another datetime object. More...
|
|
bool | operator== (const DateTime &datetime) const |
| Compare date and time with another date and time to see if the same. More...
|
|
bool | operator> (const DateTime &datetime) const |
| Compare date and time with another date and time to see if later. More...
|
|
bool | operator>= (const DateTime &datetime) const |
| Compare date and time with another date and time to see if later or the same. More...
|
|
const char * | put (char *buffer) const |
| Get a ISO formatted date and time string for current object. More...
|
|
void | set (void) |
| Set (update) the date and time with current date and time.
|
|
virtual | ~DateTime () |
| Destroy date and time object.
|
|
| Date (time_t value) |
| Create a julian date from a time_t type. More...
|
|
| Date (const struct tm *object) |
| Create a julian date from a local or gmt date and time. More...
|
|
| Date (const char *pointer, size_t size=0) |
| Create a julian date from a ISO date string of a specified size. More...
|
|
| Date (int year, unsigned month, unsigned day) |
| Create a julian date from an arbitrary year, month, and day. More...
|
|
| Date (const Date &object) |
| Create a julian date object from another object. More...
|
|
| Date () |
| Construct a new julian date with today's date.
|
|
unsigned | day (void) const |
| Get the day of the month of the date. More...
|
|
unsigned | dow (void) const |
| Get the day of the week (0-7). More...
|
|
long | get (void) const |
| Get the date as a number for the object or 0 if invalid. More...
|
|
bool | is_valid (void) const |
| Check if date is valid. More...
|
|
unsigned | month (void) const |
| Get the month of the date (1-12). More...
|
|
long | operator * () const |
| Access julian value. More...
|
|
| operator bool () const |
| Check if julian date is valid for is() expression. More...
|
|
| operator long () const |
| Casting operator to return date as number. More...
|
|
bool | operator! () const |
| Check if julian date is not valid. More...
|
|
bool | operator!= (const Date &date) const |
| Compare julian dates if not same date. More...
|
|
stringref_t | operator() () const |
| Expression operator to return an ISO date string for the current julian date. More...
|
|
const Date | operator+ (long days) const |
| Add days to julian date in an expression. More...
|
|
Date & | operator++ () |
| Increment date by one day. More...
|
|
Date & | operator+= (long offset) |
| Increment date by offset. More...
|
|
const Date | operator- (long days) const |
| Subtract days from a julian date in an expression. More...
|
|
long | operator- (const Date &date) |
| Operator to compute number of days between two dates. More...
|
|
Date & | operator-- () |
| Decrement date by one day. More...
|
|
Date & | operator-= (long offset) |
| Decrement date by offset. More...
|
|
bool | operator< (const Date &date) const |
| Compare julian date if earlier than another date. More...
|
|
bool | operator<= (const Date &date) const |
| Compare julian date if earlier than or equal to another date. More...
|
|
Date & | operator= (const Date &date) |
| Assign date from another date object. More...
|
|
bool | operator== (const Date &date) const |
| Compare julian dates if same date. More...
|
|
bool | operator> (const Date &date) const |
| Compare julian date if later than another date. More...
|
|
bool | operator>= (const Date &date) const |
| Compare julian date if later than or equal to another date. More...
|
|
const char * | put (char *buffer) const |
| Get a ISO string representation of the date (yyyy-mm-dd). More...
|
|
void | set (void) |
| Set (update) the date with current date.
|
|
void | set (const char *pointer, size_t size=0) |
| Set the julian date based on an ISO date string of specified size. More...
|
|
time_t | timeref (void) const |
| Get a time_t for the julian date if in time_t epoch. More...
|
|
int | year (void) const |
| Get the year of the date. More...
|
|
virtual | ~Date () |
| Destroy julian date object.
|
|
long | get (void) const |
| Get current time in seconds from midnight. More...
|
|
int | hour (void) const |
| Get hours from midnight. More...
|
|
bool | is_valid (void) const |
| Check if time object had valid value. More...
|
|
int | minute (void) const |
| Get minutes from current hour. More...
|
|
long | operator * () const |
| Get object time in seconds. More...
|
|
| operator bool () const |
| Check if time object has valid value for is() operator. More...
|
|
| operator long () const |
| Get time in seconds. More...
|
|
bool | operator! () const |
| Check if time object has valid value for ! operator. More...
|
|
bool | operator!= (const Time &time) const |
| Compare time with another time to see if not same time. More...
|
|
stringref_t | operator() () const |
| Convert to standard 24 hour time string. More...
|
|
const Time | operator+ (long seconds) const |
| Add seconds to the current time, wrap if 24 hours. More...
|
|
Time & | operator++ () |
| Incrememnt time by 1 second, wrap on 24 hour period. More...
|
|
Time & | operator+= (long seconds) |
| Increment time by specified seconds. More...
|
|
long | operator- (const Time &reference) |
| Get difference (in seconds) between two times. More...
|
|
const Time | operator- (long seconds) const |
| Subtract seconds to the current time, wrap if 24 hours. More...
|
|
Time & | operator-- () |
| Decrement time by 1 second, wrap on 24 hour period. More...
|
|
Time & | operator-= (long seconds) |
| Decrement time by specified seconds. More...
|
|
bool | operator< (const Time &time) const |
| Compare time if earlier than another time. More...
|
|
bool | operator<= (const Time &time) const |
| Compare time if earlier than or equal to another time. More...
|
|
Time & | operator= (const Time &time) |
| Assign a time as a copy of another time. More...
|
|
bool | operator== (const Time &time) const |
| Compare time with another time to see if same time. More...
|
|
bool | operator> (const Time &time) const |
| Compare time if later than another time. More...
|
|
bool | operator>= (const Time &time) const |
| Compare time if later than or equal to another time. More...
|
|
const char * | put (char *buffer) const |
| Get a hh:mm:ss formatted string for current time. More...
|
|
int | second (void) const |
| Get seconds from current minute. More...
|
|
void | set (int hour, int minute=0, int second=0) |
|
void | set (void) |
| Set (update) the time with current time.
|
|
void | set (const char *pointer, size_t size=0) |
| Set time from a hh:mm:ss formatted string. More...
|
|
| Time (const time_t value) |
| Create a time from the time portion of a time_t. More...
|
|
| Time (const tm_t *object) |
| Create a time from the time portion of a date and time object. More...
|
|
| Time (const char *pointer, size_t size=0) |
| Create a time from a hh:mm:ss formatted time string. More...
|
|
| Time (int hour, int minute, int second) |
| Create a time from hours (0-23), minutes (0-59), and seconds (0-59). More...
|
|
| Time (const Time &object) |
| Create a time object from another object. More...
|
|
| Time () |
| Create a time from current time.
|
|
virtual | ~Time () |
| Destroy time object.
|
|
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.
- Examples
- datetime.cpp.
Definition at line 618 of file datetime.h.