@@ -11,8 +11,8 @@ import (
1111func TestOne (t * testing.T ) {
1212 time .Local = time .UTC
1313 var ts time.Time
14- ts = MustParse ("2020-08-17T17:00:00:987+0100 " )
15- assert .Equal (t , "2020-08-17 16:00 :00.987 +0000 UTC" , fmt .Sprintf ("%v" , ts .In (time .UTC )))
14+ ts = MustParse ("2019-05-29T08:41-04 " )
15+ assert .Equal (t , "2019-05-29 12:41 :00 +0000 UTC" , fmt .Sprintf ("%v" , ts .In (time .UTC )))
1616}
1717
1818type dateTest struct {
@@ -364,6 +364,8 @@ var testInputs = []dateTest{
364364 {in : "2009-08-12T22:15:09.123-07:00" , out : "2009-08-13 05:15:09.123 +0000 UTC" },
365365 {in : "2016-06-21T19:55:00+01:00" , out : "2016-06-21 18:55:00 +0000 UTC" },
366366 {in : "2016-06-21T19:55:00.799+01:00" , out : "2016-06-21 18:55:00.799 +0000 UTC" },
367+ // yyyy-mm-ddThh:mm:ss-07 TZ truncated to 2 digits instead of 4
368+ {in : "2019-05-29T08:41-04" , out : "2019-05-29 12:41:00 +0000 UTC" },
367369 // yyyy-mm-ddThh:mm:ss-0700
368370 {in : "2009-08-12T22:15:09-0700" , out : "2009-08-13 05:15:09 +0000 UTC" },
369371 {in : "2009-08-12T22:15:09-0300" , out : "2009-08-13 01:15:09 +0000 UTC" },
@@ -376,8 +378,9 @@ var testInputs = []dateTest{
376378 {in : "2016-06-21T19:55:00.799+0100" , out : "2016-06-21 18:55:00.799 +0000 UTC" },
377379 {in : "2016-06-21T19:55+0100" , out : "2016-06-21 18:55:00 +0000 UTC" },
378380 {in : "2016-06-21T19:55+0130" , out : "2016-06-21 18:25:00 +0000 UTC" },
379- // yyyy-mm-ddThh:mm:ss:000+0000
380- {in : "2012-08-17T18:31:59.257+0100" , out : "2012-08-17 17:31:59.257 +0000 UTC" }, // https://github.com/araddon/dateparse/issues/117
381+ // yyyy-mm-ddThh:mm:ss:000+0000 - weird format with additional colon in front of milliseconds
382+ {in : "2012-08-17T18:31:59:257+0100" , out : "2012-08-17 17:31:59.257 +0000 UTC" }, // https://github.com/araddon/dateparse/issues/117
383+
381384 // yyyy-mm-ddThh:mm:ssZ
382385 {in : "2009-08-12T22:15Z" , out : "2009-08-12 22:15:00 +0000 UTC" },
383386 {in : "2009-08-12T22:15:09Z" , out : "2009-08-12 22:15:09 +0000 UTC" },
@@ -526,6 +529,8 @@ func TestParseLayout(t *testing.T) {
526529 {in : `{"hello"}` , err : true },
527530 {in : "2009-15-12T22:15Z" , err : true },
528531 {in : "5,000-9,999" , err : true },
532+ // This 3 digit TZ offset (should be 2 or 4? is 3 a thing?)
533+ {in : "2019-05-29T08:41-047" , err : true },
529534 //
530535 {in : "06/May/2008 15:04:05 -0700" , out : "02/Jan/2006 15:04:05 -0700" },
531536 {in : "06/May/2008:15:04:05 -0700" , out : "02/Jan/2006:15:04:05 -0700" },
0 commit comments