2
0
mirror of https://github.com/araddon/dateparse.git synced 2026-01-30 18:05:54 +00:00

Merge branch 'master' into colon-separator

This commit is contained in:
Aaron Raddon
2020-09-30 12:38:26 -07:00
committed by GitHub
4 changed files with 103 additions and 57 deletions

View File

@@ -11,8 +11,8 @@ import (
func TestOne(t *testing.T) {
time.Local = time.UTC
var ts time.Time
ts = MustParse("2018.09.30")
assert.Equal(t, "2018-09-30 00:00:00 +0000 UTC", fmt.Sprintf("%v", ts.In(time.UTC)))
ts = MustParse("Mon 30 Sep 2018 09:09:09 PM UTC")
assert.Equal(t, "2018-09-30 21:09:09 +0000 UTC", fmt.Sprintf("%v", ts.In(time.UTC)))
}
type dateTest struct {
@@ -44,6 +44,9 @@ var testInputs = []dateTest{
{in: "Mon Jan 2 15:04:05 2006", out: "2006-01-02 15:04:05 +0000 UTC"},
{in: "Thu May 8 17:57:51 2009", out: "2009-05-08 17:57:51 +0000 UTC"},
{in: "Thu May 8 17:57:51 2009", out: "2009-05-08 17:57:51 +0000 UTC"},
// ANSIC_GLIBC = "Mon 02 Jan 2006 03:04:05 PM UTC"
{in: "Mon 02 Jan 2006 03:04:05 PM UTC", out: "2006-01-02 15:04:05 +0000 UTC"},
{in: "Mon 30 Sep 2018 09:09:09 PM UTC", out: "2018-09-30 21:09:09 +0000 UTC"},
// RubyDate = "Mon Jan 02 15:04:05 -0700 2006"
{in: "Mon Jan 02 15:04:05 -0700 2006", out: "2006-01-02 22:04:05 +0000 UTC"},
{in: "Thu May 08 11:57:51 -0700 2009", out: "2009-05-08 18:57:51 +0000 UTC"},