summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorFelix Krause <contact@flyx.org>2016-11-14 18:46:35 +0100
committerFelix Krause <contact@flyx.org>2016-11-14 18:46:35 +0100
commit434c27343e72c4e90530d9b90c0851bc20c8ea32 (patch)
treea7179e63b1a27269bb8a3b087ced41d834b1abb8 /tests
parent0587a578075498dffaadbe7cf0ba1885eb597536 (diff)
downloadNim-434c27343e72c4e90530d9b90c0851bc20c8ea32.tar.gz
Parse 'Z' as valid timezone if offset is expected
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/ttime.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/stdlib/ttime.nim b/tests/stdlib/ttime.nim
index 39106f1e0..b28d8aecd 100644
--- a/tests/stdlib/ttime.nim
+++ b/tests/stdlib/ttime.nim
@@ -96,6 +96,10 @@ parseTest("2006-01-12T15:04:05Z-07:00", "yyyy-MM-dd'T'HH:mm:ss'Z'zzz",
 # RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
 parseTest("2006-01-12T15:04:05.999999999Z-07:00",
     "yyyy-MM-ddTHH:mm:ss.999999999Zzzz", "2006-01-12T22:04:05+00:00", 11)
+for tzFormat in ["z", "zz", "zzz"]:
+  # formatting timezone as 'Z' for UTC
+  parseTest("2001-01-12T22:04:05Z", "yyyy-MM-dd'T'HH:mm:ss" & tzFormat,
+      "2001-01-12T22:04:05+00:00", 11)
 # Kitchen     = "3:04PM"
 parseTestTimeOnly("3:04PM", "h:mmtt", "15:04:00")
 #when not defined(testing):