]> git.sur5r.net Git - i3/i3status/commitdiff
Use local timezone for battery %emptytime (#236)
authorEmeric Planet <emeric.planet@datadoghq.com>
Sat, 19 Aug 2017 12:56:30 +0000 (14:56 +0200)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Sat, 19 Aug 2017 12:56:30 +0000 (14:56 +0200)
src/print_battery_info.c

index f15cbfad1162d9cc3d8c789e33224fe2ae06dd84..e9077ec44dc56e922a760e6d93aabc26e8f0d027 100644 (file)
@@ -602,6 +602,7 @@ void print_battery_info(yajl_gen json_gen, char *buffer, int number, const char
         } else if (BEGINS_WITH(walk + 1, "emptytime")) {
             if (batt_info.seconds_remaining >= 0) {
                 time_t empty_time = time(NULL) + batt_info.seconds_remaining;
+                set_timezone(NULL); /* Use local time. */
                 struct tm *empty_tm = localtime(&empty_time);
 
                 if (hide_seconds)