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:
Mon Jan 14 03:17:30 2019 +0000
Parent:
24:45a9e7081499
Child:
27:67e4e2ab048a
Child:
30:2740e128a809
Commit message:
Modified mktime to include the tzo_min factor that would have been previously set.

Changed in this revision

TimeInterface.cpp Show annotated file Show diff for this revision Revisions of this file
TimeInterface.h Show annotated file Show diff for this revision Revisions of this file
--- a/TimeInterface.cpp	Mon Aug 13 00:54:52 2018 +0000
+++ b/TimeInterface.cpp	Mon Jan 14 03:17:30 2019 +0000
@@ -259,6 +259,7 @@
 
 time_t TimeInterface::mktime(struct tm_ex * timeptr)
 {
+    timeptr->tm_tzo_min = get_tzo_min();
     return std::mktime((struct tm *)timeptr);
 }
 
--- a/TimeInterface.h	Mon Aug 13 00:54:52 2018 +0000
+++ b/TimeInterface.h	Mon Jan 14 03:17:30 2019 +0000
@@ -290,6 +290,9 @@
     /// Convert a tm_ex structure (an extended time structure) to a time_t
     /// value.
     ///
+    /// This function also sets the tzo_min element of the tm_ex structure
+    /// from the previously set tzo_min.
+    /// 
     /// @param[in] timeptr is a pointer to a tm_ex structure.
     /// @returns the computed time_t value.
     ///