RTClib
|
Timespan which can represent changes in time with seconds accuracy. More...
#include <RTClib.h>
Public Member Functions | |
TimeSpan (int32_t seconds=0) | |
Create a new TimeSpan object in seconds. More... | |
TimeSpan (int16_t days, int8_t hours, int8_t minutes, int8_t seconds) | |
Create a new TimeSpan object using a number of days/hours/minutes/seconds e.g. Make a TimeSpan of 3 hours and 45 minutes: new TimeSpan(0, 3, 45, 0);. More... | |
TimeSpan (const TimeSpan ©) | |
Copy constructor, make a new TimeSpan using an existing one. More... | |
int16_t | days () const |
Number of days in the TimeSpan e.g. 4. More... | |
int8_t | hours () const |
Number of hours in the TimeSpan This is not the total hours, it includes the days e.g. 4 days, 3 hours - NOT 99 hours. More... | |
int8_t | minutes () const |
Number of minutes in the TimeSpan This is not the total minutes, it includes days/hours e.g. 4 days, 3 hours, 27 minutes. More... | |
int8_t | seconds () const |
Number of seconds in the TimeSpan This is not the total seconds, it includes the days/hours/minutes e.g. 4 days, 3 hours, 27 minutes, 7 seconds. More... | |
int32_t | totalseconds () const |
Total number of seconds in the TimeSpan, e.g. 358027. More... | |
TimeSpan | operator+ (const TimeSpan &right) const |
Add two TimeSpans. More... | |
TimeSpan | operator- (const TimeSpan &right) const |
Subtract a TimeSpan. More... | |
Protected Attributes | |
int32_t | _seconds |
Actual TimeSpan value is stored as seconds. | |
Timespan which can represent changes in time with seconds accuracy.
TimeSpan::TimeSpan | ( | int32_t | seconds = 0 | ) |
Create a new TimeSpan object in seconds.
seconds | Number of seconds |
TimeSpan::TimeSpan | ( | int16_t | days, |
int8_t | hours, | ||
int8_t | minutes, | ||
int8_t | seconds | ||
) |
Create a new TimeSpan object using a number of days/hours/minutes/seconds e.g. Make a TimeSpan of 3 hours and 45 minutes: new TimeSpan(0, 3, 45, 0);.
days | Number of days |
hours | Number of hours |
minutes | Number of minutes |
seconds | Number of seconds |
TimeSpan::TimeSpan | ( | const TimeSpan & | copy | ) |
|
inline |
Number of days in the TimeSpan e.g. 4.
|
inline |
Number of hours in the TimeSpan This is not the total hours, it includes the days e.g. 4 days, 3 hours - NOT 99 hours.
|
inline |
Number of minutes in the TimeSpan This is not the total minutes, it includes days/hours e.g. 4 days, 3 hours, 27 minutes.
|
inline |
Number of seconds in the TimeSpan This is not the total seconds, it includes the days/hours/minutes e.g. 4 days, 3 hours, 27 minutes, 7 seconds.
|
inline |
Total number of seconds in the TimeSpan, e.g. 358027.