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.
Dependents: CI-data-logger-server WattEye X10Svr SSDP_Server
Diff: TimeInterface.h
- Revision:
- 14:b5c01a52bff4
- Parent:
- 11:1d880a50da8a
- Child:
- 16:6280e99501f8
--- a/TimeInterface.h Sun Jan 22 19:31:44 2017 +0000 +++ b/TimeInterface.h Sat Feb 04 19:33:35 2017 +0000 @@ -180,6 +180,12 @@ /// @note Unlike the standard ctime function, this version DOES NOT append /// a newline character to the buffer. /// + /// @code + /// time_t tNow = timelocal(); + /// tm_ex * tEx = localtime(&tNow); + /// printf("Time is %s\r\n", asctime(tEx)); + /// @endcode + /// /// @param[in] timeptr is a pointer to a tm structure containing the time to convert. /// @returns a pointer to a private buffer containing the string. /// @@ -212,6 +218,11 @@ /// @note Watch out for race conditions as this returns a pointer to a /// shared buffer. /// + /// @code + /// time_t tNow = timelocal(); + /// tm_ex * tEx = localtime(&tNow); + /// @endcode + /// /// @param[in] timer is a pointer to a time_t structure to convert. /// @returns pointer to a tm structure. ///