From: Emeric Planet Date: Sat, 19 Aug 2017 12:56:30 +0000 (+0200) Subject: Use local timezone for battery %emptytime (#236) X-Git-Tag: 2.12~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ca9bee8b885e810fd849abcb9b544b487636854c;p=i3%2Fi3status Use local timezone for battery %emptytime (#236) --- diff --git a/src/print_battery_info.c b/src/print_battery_info.c index f15cbfa..e9077ec 100644 --- a/src/print_battery_info.c +++ b/src/print_battery_info.c @@ -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)