Skip to content

Commit

Permalink
Add timezone support
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussy committed Feb 20, 2021
1 parent 6fb7f6a commit e003285
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ SOFTWARE. */
// NTP Server
//
#ifndef TIMESERVER
#define TIMESERVER "pool.ntp.org"
#define TIMESERVER "pool.ntp.org", "time.nist.gov"
// #define THISTZ TZ_Etc_GMT
#define THISTZ TZ_America_Chicago
#endif
//
//////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/ntp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void setClock()
int cycle = 0;
while (time(nullptr) < EPOCH_1_1_2019)
{
configTime("GMT", "pool.ntp.org", "time.nist.gov");
configTime(THISTZ, TIMESERVER);
if (time(nullptr) - startSecs > 9)
{
if (cycle > 9)
Expand Down
1 change: 1 addition & 0 deletions src/ntp.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ SOFTWARE. */
#include "config.h"
#include "tools.h"
#include "serialhandler.h"
#include <TZ.h>
#include <Ticker.h>
#include <ArduinoLog.h>

Expand Down

0 comments on commit e003285

Please sign in to comment.