A class for time manipulation.
More...
#include <edelib/DateTime.h>
|
static bool | is_valid (unsigned char h, unsigned char m, unsigned char s) |
|
A class for time manipulation.
This class allows you to manipulate with time, fetch or set one. Hour can be 0 <= hour < 24. Minutes and seconds are in 0 <= val < 60.
- Note
- Time where hour is 0 is always less than time where hour is 23.
- Todo:
- Time is missing local/UTC option.
Constructor that will set all time members to 0. This is valid time.
Construct time via previously declared value
unsigned char hour |
( |
void |
| ) |
const |
|
inline |
static bool is_valid |
( |
unsigned char |
h, |
|
|
unsigned char |
m, |
|
|
unsigned char |
s |
|
) |
| |
|
static |
Check if given parameters can be valid time
- Returns
- true if time is valid
- Parameters
-
h | is hour |
m | is minutes |
s | is seconds |
unsigned char minute |
( |
void |
| ) |
const |
|
inline |
Increase current time by one. First seconds are increased; when they reach 59, minutes are increased and seconds are set to 0. The same applies for minutes/hour case. When hour reach for 23, it is set to 0 (the same behaviour as you see from your digital clock).
Assign previously declared value. Current time will be replaced.
unsigned char second |
( |
void |
| ) |
const |
|
inline |
void set |
( |
unsigned char |
h, |
|
|
unsigned char |
m, |
|
|
unsigned char |
s = 0 |
|
) |
| |
Set time values. Values should be valid time, or assertion will be triggered.
- Parameters
-
h | is hour |
m | is minutes |
s | is seconds |
Read system time and fill internal values
- Todo:
- This should be probably a static function
Tries to set system time with current values. This function requires priviledged user. It behaves the same as Date::system_set() (see it's documentation for detail description).
- Todo:
- This should be probably a static function
The documentation for this class was generated from the following file: