summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorskilchen <skilchen@bluewin.ch>2018-04-16 17:40:54 +0200
committerskilchen <skilchen@bluewin.ch>2018-04-16 17:40:54 +0200
commitbf6e82a8611428fde85a0017166f316599c4228e (patch)
tree8d132ca68a4393623f399615df107f5a876b0ff1 /tests
parent04df7f147c6e08b28113173328d7e03fce381af9 (diff)
downloadNim-bf6e82a8611428fde85a0017166f316599c4228e.tar.gz
there is no hour 0 in am/pm time
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/ttimes.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/stdlib/ttimes.nim b/tests/stdlib/ttimes.nim
index f35965286..4f1a43f15 100644
--- a/tests/stdlib/ttimes.nim
+++ b/tests/stdlib/ttimes.nim
@@ -28,6 +28,12 @@ t.checkFormat("d dd ddd dddd h hh H HH m mm M MM MMM MMMM s" &
 
 t.checkFormat("yyyyMMddhhmmss", "20380119031407")
 
+# issue 7620
+let t7620_am = parse("4/15/2017 12:01:02 AM +0", "M/d/yyyy' 'h:mm:ss' 'tt' 'z", utc())
+t7620_am.checkFormat("M/d/yyyy' 'h:mm:ss' 'tt' 'z", "4/15/2017 12:01:02 AM +0")
+let t7620_pm = parse("4/15/2017 12:01:02 PM +0", "M/d/yyyy' 'h:mm:ss' 'tt' 'z", utc())
+t7620_pm.checkFormat("M/d/yyyy' 'h:mm:ss' 'tt' 'z", "4/15/2017 12:01:02 PM +0")
+
 let t2 = fromUnix(160070789).utc # Mon 27 Jan 16:06:29 GMT 1975
 t2.checkFormat("d dd ddd dddd h hh H HH m mm M MM MMM MMMM s" &
   " ss t tt y yy yyy yyyy yyyyy z zz zzz",