| 844 | } |
| 845 | |
| 846 | String formatUtcToLocal(const String &s) { |
| 847 | int h, m, ss = 0; |
| 848 | if (sscanf(s.c_str(), "%d:%d:%d", &h, &m, &ss) < 2 || h > 23 || m > 59 || ss > 59) |
| 849 | return "-"; |
| 850 | |
| 851 | time_t n = time(nullptr); |
| 852 | struct tm tm = *localtime(&n); |
| 853 | tm.tm_hour = h; |
| 854 | tm.tm_min = m; |
| 855 | tm.tm_sec = ss; |
| 856 | |
| 857 | time_t utc = mktime(&tm) - _timezone + (tm.tm_isdst ? 3600 : 0); |
| 858 | localtime_r(&utc, &tm); |
| 859 | |
| 860 | char buf[6]; |
| 861 | snprintf(buf, 6, "%02d:%02d", tm.tm_hour, tm.tm_min); |
| 862 | return buf; |
| 863 | } |
| 864 | |
| 865 | void drawDate(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, imgParam &imageParams) { |
| 866 | time_t now; |