forked from bracci/Qlockthree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TimeStamp.h
71 lines (56 loc) · 1.6 KB
/
TimeStamp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
TimeStamp
Klasse fuer die Kapselung eines Zeitstempels. Dadurch lassen sich
Zeiten aus der Echtzeituhr und von dem DCF77-Empfaenger
leichter verarbeiten und vergleichen.
@mc Arduino/RBBB
@autor Christian Aschoff / caschoff _AT_ mac _DOT_ com
@version 1.7a
@created 2.3.2011
*/
#ifndef TIMESTAMP_H
#define TIMESTAMP_H
#include "Arduino.h"
class TimeStamp {
public:
TimeStamp(byte minutes, byte hours, byte date, byte dayOfWeek, byte month, byte year);
void incMinutes();
void decMinutes();
void incFiveMinutes();
void decFiveMinutes();
void incHours();
void decHours();
void incDate(byte addDate = 1);
void incMonth(byte addMonth = 1);
void incYear(byte addYear = 1);
byte getMinutes();
int getMinutesOfDay(int minutesDiff);
int getMinutesOf12HoursDay(int minutesDiff);
byte getHours();
byte getDate();
byte getDayOfWeek();
byte getMonth();
byte getYear();
unsigned long getMinutesOfCentury();
void setMinutes(byte minutes);
void setHours(byte hours);
void setDate(byte date);
void setDayOfWeek(byte dayOfWeek);
void setMonth(byte month);
void setYear(byte year);
void set(byte minutes, byte hours, byte date, byte dayOfWeek, byte month, byte year);
void set(TimeStamp* timeStamp);
char* asString();
protected:
byte getDaysOfMonth(byte month, byte year);
void CalculateAndSetDayOfWeek();
void CheckDateValidity();
byte _minutes;
byte _hours;
byte _date;
byte _dayOfWeek;
byte _month;
byte _year;
char _cDateTime[17];
};
#endif