File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ extern struct tm* sntp_localtime(const time_t *clock);
3535#define DIFF1900TO1970 2208988800UL
3636
3737static int s_daylightOffset_sec = 0 ;
38- static int s_timezone_sec = 0 ;
38+ static long s_timezone_sec = 0 ;
3939static time_t s_bootTime = 0 ;
4040
4141// calculate offset used in gettimeofday
@@ -46,7 +46,7 @@ static void ensureBootTimeIsSet()
4646 time_t now = sntp_get_current_timestamp ();
4747 if (now )
4848 {
49- s_bootTime = - millis () / 1000 ;
49+ s_bootTime = now - millis () / 1000 ;
5050 }
5151 }
5252}
@@ -56,7 +56,7 @@ static void setServer(int id, const char* name_or_ip)
5656 if (name_or_ip )
5757 {
5858 //TODO: check whether server is given by name or IP
59- sntp_setservername (0 , (char * ) name_or_ip );
59+ sntp_setservername (id , (char * ) name_or_ip );
6060 }
6161}
6262
@@ -92,7 +92,6 @@ time_t mktime(struct tm *t)
9292time_t time (time_t * t )
9393{
9494 time_t seconds = sntp_get_current_timestamp ();
95- ensureBootTimeIsSet ();
9695 if (t )
9796 {
9897 * t = seconds ;
You can’t perform that action at this time.
0 commit comments