From 92be35c42a33384d8dceef7112f1001f64ad101c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 29 Mar 2021 00:58:40 -0400 Subject: fix time since calculations for borg borg reports times in the local time zone, but doesn't indicate that, so we need to tell ruby the right thing --- modules/tick/files/plugins/borg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/tick/files/plugins/borg b/modules/tick/files/plugins/borg index 3e2f1b6..b965cd7 100644 --- a/modules/tick/files/plugins/borg +++ b/modules/tick/files/plugins/borg @@ -11,7 +11,9 @@ repository = data[0]["repository"] archive = data[0]["archives"][0] location = repository["location"] -ago_s = now - DateTime.iso8601(archive["end"]).to_time +end_without_tz = DateTime.iso8601(archive["end"]).to_time +local_end = end_without_tz.getlocal - end_without_tz.getlocal.utc_offset +ago_s = now - local_end dur_s = archive["duration"].to_f file_size_b = archive["stats"]["original_size"] file_count_n = archive["stats"]["nfiles"] -- cgit v1.2.3-54-g00ecf