We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a122c56 commit 25d3152Copy full SHA for 25d3152
1 file changed
src/assert_dates.sh
@@ -12,10 +12,16 @@ function bashunit::date::to_epoch() {
12
;;
13
esac
14
15
- # Normalize ISO 8601: replace T with space, strip Z suffix, strip tz offset
+ # Normalize Z suffix to +0000 (understood by both GNU and BSD date)
16
+ case "$input" in
17
+ *Z)
18
+ input="${input%Z}+0000"
19
+ ;;
20
+ esac
21
+
22
+ # Normalize ISO 8601: replace T with space, strip tz offset
23
local normalized="$input"
24
normalized="${normalized/T/ }"
- normalized="${normalized%Z}"
25
# Strip timezone offset (+HHMM or -HHMM) at end for initial parsing
26
case "$normalized" in
27
*[+-][0-9][0-9][0-9][0-9])
0 commit comments