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