Andrew Boyson / clock

Dependents:   oldheating gps motorhome heating

Revision:
38:25b2a3c494aa
Parent:
37:330b844f54b6
Child:
44:aa45226d118e
--- a/tm/tm.c	Sat Dec 01 19:13:29 2018 +0000
+++ b/tm/tm.c	Sun Dec 02 18:38:22 2018 +0000
@@ -3,7 +3,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdbool.h>
-#include <stdint.h>
 
 #define STD_OFFSET 0
 #define DST_OFFSET 1
@@ -161,7 +160,7 @@
         ++*pMonth;
     }
 }
-static void timeToTm(int64_t t, struct tm* ptm, bool local)
+static void timeToTm(time_t t, struct tm* ptm, bool local)
 {
     //Extract the seconds, minutes, hours and days from the time_t t
     div_t divres;
@@ -216,17 +215,17 @@
 }
 
 
-void TmUtcFromSeconds1970(int64_t time, struct tm* ptm)
+void TmUtcFromTimeT(time_t time, struct tm* ptm)
 {
     timeToTm(time, ptm, false);
 }
-void TmLocalFromSeconds1970(int64_t time, struct tm* ptm)
+void TmLocalFromTimeT(time_t time, struct tm* ptm)
 {
     timeToTm(time, ptm, true);
 }
-int64_t TmUtcToSeconds1970(struct tm* ptm)
+time_t TmUtcToTimeT(struct tm* ptm)
 {
-    int64_t days = 0;
+    time_t days = 0;
     
     for (int y = 70; y < ptm->tm_year; y++) days += isLeapYear(y) ? 366 : 365;