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:
- 15:82bd8fc6f317
- Parent:
- 11:1d880a50da8a
- Child:
- 16:6280e99501f8
diff -r 1d880a50da8a -r 82bd8fc6f317 TimeInterface.h --- a/TimeInterface.h Sun Jan 22 19:31:44 2017 +0000 +++ b/TimeInterface.h Sat Mar 04 16:55:15 2017 +0000 @@ -230,9 +230,51 @@ /// @param[out] ptr is a pointer to the user buffer. /// @param[in] maxsize is the size of the user buffer. /// @param[in] format is a pointer to the special strftime format specification. + /// see format options. /// @param[in] timeptr is a pointer to the tm_ex structure. /// @returns the total number of characters copied into the buffer. /// + /// format options: + /// - %%a Abbreviated weekday name e.g. Thu + /// - %%A Full weekday name e.g. Thursday + /// - %%b Abbreviated month name e.g. Aug + /// - %%B Full month name e.g. August + /// - %%c Date and time representation e.g. Thu Aug 23 14:55:02 2001 + /// - %%C Year divided by 100 and truncated to integer (00-99) e.g. 20 + /// - %%d Day of the month, zero-padded (01-31) e.g. 23 + /// - %%D Short MM/DD/YY date, equivalent to %%m/%%d/%%y e.g. 08/23/01 + /// - %%e Day of the month, space-padded ( 1-31) e.g. 23 + /// - %%F Short YYYY-MM-DD date, equivalent to %%Y-%%m-%%d e.g. 2001-08-23 + /// - %%g Week-based year, last two digits (00-99) e.g. 01 + /// - %%G Week-based year e.g. 2001 + /// - %%h Abbreviated month name * (same as %%b) e.g. Aug + /// - %%H Hour in 24h format (00-23) e.g. 14 + /// - %%I Hour in 12h format (01-12) e.g. 02 + /// - %%j Day of the year (001-366) e.g. 235 + /// - %%m Month as a decimal number (01-12) e.g. 08 + /// - %%M Minute (00-59) e.g. 55 + /// - %%n New-line character ('\\n') + /// - %%p AM or PM designation e.g. PM + /// - %%r 12-hour clock time e.g. 02:55:02 pm + /// - %%R 24-hour HH:MM time, equivalent to %%H:%%M e.g. 14:55 + /// - %%S Second (00-61) e.g. 02 + /// - %%t Horizontal-tab character ('\t') + /// - %%T ISO 8601 time format (HH:MM:SS), equivalent to %%H:%%M:%%S e.g. 14:55:02 + /// - %%u ISO 8601 weekday as number with Monday as 1 (1-7) e.g. 4 + /// - %%U Week number with the first Sunday as the first day of week one (00-53) e.g. 33 + /// - %%V ISO 8601 week number (00-53) e.g. 34 + /// - %%w Weekday as a decimal number with Sunday as 0 (0-6) e.g. 4 + /// - %%W Week number with the first Monday as the first day of week one (00-53) e.g. 34 + /// - %%x Date representation e.g. 08/23/01 + /// - %%X Time representation e.g. 14:55:02 + /// - %%y Year, last two digits (00-99) e.g. 01 + /// - %%Y Year e.g. 2001 + /// - %%z ISO 8601 offset from UTC in timezone (1 minute=1, 1 hour=100) (e.g. +100) + /// If timezone cannot be determined, no characters + /// - %%Z Timezone name or abbreviation (e.g. CDT) + /// If timezone cannot be determined, no characters + /// - % A % sign + /// size_t strftime(char * ptr, size_t maxsize, const char * format, const struct tm_ex * timeptr);