summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmeric Planet <emeric.planet@datadoghq.com>2017-08-19 14:56:30 +0200
committerMichael Stapelberg <stapelberg@users.noreply.github.com>2017-08-19 14:56:30 +0200
commitca9bee8b885e810fd849abcb9b544b487636854c (patch)
tree32b3486d7881c5c8b641c0adf821fb9187f9380d /src
parent0e406a1f3b6b6b00f78aea838cc4396b0584d085 (diff)
Use local timezone for battery %emptytime (#236)
Diffstat (limited to 'src')
-rw-r--r--src/print_battery_info.c1
1 files changed, 1 insertions, 0 deletions
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)