The Time class uses a integer representation of the current time. More...
#include <datetime.h>

Public Member Functions | |
| const char * | get (char *buffer) const |
| long | get (void) const |
| Get current time in seconds from midnight. | |
| int | getHour (void) const |
| int | getMinute (void) const |
| int | getSecond (void) const |
| int | hour (void) const |
| Get hours from midnight. | |
| bool | is_valid (void) const |
| Check if time object had valid value. | |
| bool | isValid (void) const |
| int | minute (void) const |
| Get minutes from current hour. | |
| operator bool () const | |
| Check if time object has valid value for is() operator. | |
| operator long () | |
| Get time in seconds. | |
| bool | operator! () const |
| Check if time object has valid value for ! operator. | |
| bool | operator!= (const Time &time) const |
| Compare time with another time to see if not same time. | |
| String | operator() () const |
| Convert to standard 24 hour time string. | |
| long | operator* () const |
| Get object time in seconds. | |
| Time | operator+ (long seconds) |
| Add seconds to the current time, wrap if 24 hours. | |
| Time & | operator++ () |
| Incrememnt time by 1 second, wrap on 24 hour period. | |
| Time & | operator+= (long seconds) |
| Increment time by specified seconds. | |
| Time | operator- (long seconds) |
| Subtract seconds to the current time, wrap if 24 hours. | |
| long | operator- (const Time &reference) |
| Get difference (in seconds) between two times. | |
| Time & | operator-- () |
| Decrement time by 1 second, wrap on 24 hour period. | |
| Time & | operator-= (long seconds) |
| Decrement time by specified seconds. | |
| bool | operator< (const Time &time) const |
| Compare time if earlier than another time. | |
| bool | operator<= (const Time &time) const |
| Compare time if earlier than or equal to another time. | |
| Time & | operator= (const Time &time) |
| Assign a time as a copy of another time. | |
| bool | operator== (const Time &time) const |
| Compare time with another time to see if same time. | |
| bool | operator> (const Time &time) const |
| Compare time if later than another time. | |
| bool | operator>= (const Time &time) const |
| Compare time if later than or equal to another time. | |
| const char * | put (char *buffer) const |
| Get a hh:mm:ss formatted string for current time. | |
| int | second (void) const |
| Get seconds from current minute. | |
| void | set (const char *pointer, size_t size=0) |
| Set time from a hh:mm:ss formatted string. | |
| void | set (void) |
| Set (update) the time with current time. | |
| void | set (int hour, int minute=0, int second=0) |
| Time (int h, int m, int s) | |
| Time (const char *ptr, size_t size) | |
| Time (tm_t *object) | |
| Time (time_t value) | |
| Time () | |
| Create a time from current time. | |
| Time (const Time &object) | |
| Create a time object from another object. | |
| Time (int hour, int minute, int second) | |
| Create a time from hours (0-23), minutes (0-59), and seconds (0-59). | |
| Time (const char *pointer, size_t size=0) | |
| Create a time from a hh:mm:ss formatted time string. | |
| Time (tm_t *object) | |
| Create a time from the time portion of a date and time object. | |
| Time (time_t value) | |
| Create a time from the time portion of a time_t. | |
| virtual | ~Time () |
| Destroy time object. | |
Static Public Attributes | |
| static const long | c_day |
| Constant for number of seconds in a day. | |
| static const long | c_hour |
| Constant for number of seconds in a hour. | |
| static const long | c_week |
| Constant for number of seconds in a week. | |
| static const size_t | sz_string |
| Size of time string field. | |
Protected Member Functions | |
| void | fromSeconds (char *buf) const |
| void | toSeconds (int h, int m=0, int s=0) |
| virtual void | update (void) |
Protected Attributes | |
| long | seconds |
The Time class uses a integer representation of the current time.
This is then manipulated in several forms and may be exported as needed. The time object can represent an instance in time (hours, minutes, and seconds) in a 24 hour period or can represent a duration. Millisecond accuracy can be offered.
Definition at line 345 of file datetime.h.
| Time::Time | ( | time_t | value | ) |
Create a time from the time portion of a time_t.
| value | of time_t to use. |
| Time::Time | ( | tm_t * | object | ) |
Create a time from the time portion of a date and time object.
| object | from DateTime::glt() or gmt(). |
| Time::Time | ( | const char * | pointer, | |
| size_t | size = 0 | |||
| ) |
Create a time from a hh:mm:ss formatted time string.
| pointer | to formatted time field. | |
| size | of field if not null terminated. |
| Time::Time | ( | int | hour, | |
| int | minute, | |||
| int | second | |||
| ) |
Create a time from hours (0-23), minutes (0-59), and seconds (0-59).
| hour | of time. | |
| minute | of time. | |
| second | of time. |
| Time::Time | ( | const Time & | object | ) |
Create a time object from another object.
| object | to copy. |
| long Time::get | ( | void | ) | const |
Get current time in seconds from midnight.
Reimplemented in DateTime.
| int Time::hour | ( | void | ) | const |
Get hours from midnight.
| bool Time::is_valid | ( | void | ) | const |
| int Time::minute | ( | void | ) | const |
Get minutes from current hour.
| Time::operator bool | ( | ) | const [inline] |
Check if time object has valid value for is() operator.
Reimplemented in DateTime.
Definition at line 472 of file datetime.h.
| Time::operator long | ( | ) | [inline] |
| bool Time::operator! | ( | ) | const [inline] |
Check if time object has valid value for ! operator.
Reimplemented in DateTime.
Definition at line 479 of file datetime.h.
| bool Time::operator!= | ( | const Time & | time | ) | const |
Compare time with another time to see if not same time.
| time | to compare with. |
Reimplemented in DateTime.
| String Time::operator() | ( | ) | const |
Convert to standard 24 hour time string.
| long Time::operator* | ( | ) | const [inline] |
| Time Time::operator+ | ( | long | seconds | ) |
Add seconds to the current time, wrap if 24 hours.
| seconds | to add. |
Reimplemented in DateTime.
| Time& Time::operator++ | ( | ) |
Incrememnt time by 1 second, wrap on 24 hour period.
Reimplemented in DateTime.
| Time& Time::operator+= | ( | long | seconds | ) |
Increment time by specified seconds.
Wraps on 24 hour period.
| seconds | to add to current time. |
Reimplemented in DateTime.
| Time Time::operator- | ( | long | seconds | ) |
Subtract seconds to the current time, wrap if 24 hours.
| seconds | to subtract. |
Reimplemented in DateTime.
| long Time::operator- | ( | const Time & | reference | ) |
Get difference (in seconds) between two times.
| reference | time to get difference from. |
Reimplemented in DateTime.
| Time& Time::operator-- | ( | ) |
Decrement time by 1 second, wrap on 24 hour period.
Reimplemented in DateTime.
| Time& Time::operator-= | ( | long | seconds | ) |
Decrement time by specified seconds.
Wraps on 24 hour period.
| seconds | to subtract from current time. |
Reimplemented in DateTime.
| bool Time::operator< | ( | const Time & | time | ) | const |
Compare time if earlier than another time.
| time | object to compare with. |
Reimplemented in DateTime.
| bool Time::operator<= | ( | const Time & | time | ) | const |
Compare time if earlier than or equal to another time.
| time | object to compare with. |
Reimplemented in DateTime.
Assign a time as a copy of another time.
| time | to assign from. |
Reimplemented in DateTime.
| bool Time::operator== | ( | const Time & | time | ) | const |
Compare time with another time to see if same time.
| time | to compare with. |
Reimplemented in DateTime.
| bool Time::operator> | ( | const Time & | time | ) | const |
Compare time if later than another time.
| time | object to compare with. |
Reimplemented in DateTime.
| bool Time::operator>= | ( | const Time & | time | ) | const |
Compare time if later than or equal to another time.
| time | object to compare with. |
Reimplemented in DateTime.
| const char* Time::put | ( | char * | buffer | ) | const |
Get a hh:mm:ss formatted string for current time.
| buffer | to store time string in. |
Reimplemented in DateTime.
| int Time::second | ( | void | ) | const |
Get seconds from current minute.
| void Time::set | ( | const char * | pointer, | |
| size_t | size = 0 | |||
| ) |
Set time from a hh:mm:ss formatted string.
| pointer | to time field. | |
| size | of field if not null terminated. |
1.6.1