| 20 | string _timestringbuffer = ""; |
| 21 | |
| 22 | const char *timestring(time_t t, bool local, const char *fmt, char *buf) |
| 23 | { |
| 24 | #ifdef NO_POSIX_R |
| 25 | struct tm *timeinfo; |
| 26 | timeinfo = local ? localtime(&t) : gmtime (&t); |
| 27 | #else |
| 28 | struct tm *timeinfo, b; |
| 29 | timeinfo = local ? localtime_r(&t, &b) : gmtime_r(&t, &b); |
| 30 | #endif |
| 31 | strftime(buf, sizeof(string) - 1, fmt && *fmt ? fmt : "%Y%m%d_%H.%M.%S", timeinfo); // sortable time for filenames |
| 32 | return buf; |
| 33 | } |
| 34 | |
| 35 | const char *asctimestr() |
| 36 | { |
no outgoing calls
no test coverage detected