From e15df3b70faa1c24aca0361e4c89b78b7b55c5c8 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 11 Feb 2024 17:11:05 +0100 Subject: [PATCH] scripts/treno: bypass timezone insanity --- scripts/treno | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/scripts/treno b/scripts/treno index bc5a325..f6dc4c5 100755 --- a/scripts/treno +++ b/scripts/treno @@ -118,18 +118,9 @@ EOF def green($x): "\u001B[1;32m\($x)\u001B[0m"; def blue($x): "\u001B[1;34m\($x)\u001B[0m"; - def parse_iso8601: - # Parse an ISO 8601 date with timezone information - capture("(?[^.]*)(?\\.\\d+)?(?:(?:(?[-+])(?\\d{2}):?(?\\d{2})?)|Z)$") | - (.no_tz + "Z" | fromdateiso8601) - + ("0"+.frac_sec | tonumber) - - (.tz_sgn + "60" | tonumber) - * ((.tz_hr // "0" | tonumber) * 60 + (.tz_min // "0" | tonumber)) - | todateiso8601 | strptime("%FT%TZ"); - def time: # Extracts "HH:MM" from a timestamp - parse_iso8601 | mktime | strftime("%R"); + match("T([0-9]+:[0-9]+)"; null) | .captures[0].string; def delta($stop; $start): # Computes the time elapsed between two dates