-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNTPClock.h
More file actions
57 lines (46 loc) · 1.14 KB
/
NTPClock.h
File metadata and controls
57 lines (46 loc) · 1.14 KB
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
#ifndef _H_NTPCLOCK
#define _H_NTPCLOCK
#include <Arduino.h>
class NTPClock
{
private:
// Contructor
// ====================================================
NTPClock( void );
// timer
unsigned long delayTimer = 0;
int refreshRate = 15 * 60 * 1000;
// time
String timeArray[3];
String timeStamp;
long hour;
long minute;
long second;
long millisSinceSync;
long milliTimeStamp;
unsigned long epochTime;
int timeOffset;
int epochDay;
public:
static NTPClock& getInstance( void )
{
static NTPClock ntpclock;
return ntpclock;
}
// destructor
~NTPClock( void );
// M
// ====================================================
void begin( int offset = 0, int customRefreshRate = 0 );
void update( void );
void sync( void );
bool isDST(time_t t);
void timeToMillis( long hour, long minute, long second );
String getFormattedTime( unsigned long epochTime );
String getTime( String selector = "all" );
String getDate( String selector = "full" );
String getWeekDay( String selector = "full", String lang = "de" );
String getMonth( String selector = "full", String lang = "de" );
void setDelayTimer( void );
};
#endif