A time interface class. This class replicates the normal time functions, but goes a couple of steps further. mbed library 82 and prior has a defective gmtime function. Also, this class enables access to setting the time, and adjusting the accuracy of the RTC.

Dependencies:   CalendarPage

Dependents:   CI-data-logger-server WattEye X10Svr SSDP_Server

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Sun Sep 13 15:06:14 2020 +0000
Parent:
32:00ee2ad29da0
Commit message:
Correct gmtime and localtime apis.

Changed in this revision

TimeInterface.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 00ee2ad29da0 -r e49b25bdbfa5 TimeInterface.cpp
--- a/TimeInterface.cpp	Sun Sep 13 14:55:01 2020 +0000
+++ b/TimeInterface.cpp	Sun Sep 13 15:06:14 2020 +0000
@@ -222,7 +222,7 @@
     return result;
 }
 
-struct tm_ex * TimeInterface::gmtime(const time_t * timer)
+struct tm_ex * TimeInterface::localtime(const time_t * timer)
 {
     time_t priv = *timer + get_tzo_min() * 60 + dst * 3600;
     struct tm * tmp = std::localtime(&priv);
@@ -240,7 +240,7 @@
     return &tm_ext;
 }
 
-struct tm_ex * TimeInterface::localtime(const time_t * timer)
+struct tm_ex * TimeInterface::gmtime(const time_t * timer)
 {
     struct tm * tmp = std::localtime(timer);