diff --git a/logcat_entry.cpp b/logcat_entry.cpp index 86de810..5a844d0 100644 --- a/logcat_entry.cpp +++ b/logcat_entry.cpp @@ -60,8 +60,12 @@ const char* to_string_lower(Buffer buffer) { } std::string to_string(const LogcatEntry& logcat_entry) { + struct tm tm = logcat_entry.time; + time_t time = mktime(&tm); + gmtime_r(&time, &tm); + char logcat_style_time_as_str[32] = {0}; - strftime(logcat_style_time_as_str, 31 * sizeof(char), "%Y-%m-%d %H:%M:%S", &logcat_entry.time); + strftime(logcat_style_time_as_str, 31 * sizeof(char), "%Y-%m-%d %H:%M:%S", &tm); return std::string(logcat_style_time_as_str) + ' ' + leftpad(logcat_entry.user.value_or(" "), 5)