From 3bd2566cb7783f405a4696e323459bc758ec9d0e Mon Sep 17 00:00:00 2001 From: Aaron Raddon Date: Mon, 17 Jul 2017 15:08:31 -0700 Subject: [PATCH] doc update --- README.md | 6 +----- example/main.go | 16 +++++++++------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9cd5fb6..e7851da 100644 --- a/README.md +++ b/README.md @@ -88,11 +88,7 @@ func main() { table.AddHeaders("Input", "Parsed, and Output as %v") for _, dateExample := range examples { - t, err := dateparse.ParseAny(dateExample) - if err != nil { - panic(err.Error()) - } - table.AddRow(dateExample, fmt.Sprintf("%v", t)) + table.AddRow(dateExample, fmt.Sprintf("%v", dateparse.MustParse(dateExample))) } fmt.Println(table.Render()) } diff --git a/example/main.go b/example/main.go index bed1a75..d5b6922 100644 --- a/example/main.go +++ b/example/main.go @@ -14,9 +14,10 @@ var examples = []string{ "Mon Jan 02 15:04:05 -0700 2006", "Monday, 02-Jan-06 15:04:05 MST", "Mon, 02 Jan 2006 15:04:05 MST", + "Tue, 11 Jul 2017 16:28:13 +0200 (CEST)", + "Mon, 02 Jan 2006 15:04:05 -0700", "Mon Aug 10 15:44:11 UTC+0100 2015", "Fri Jul 03 2015 18:04:07 GMT+0100 (GMT Daylight Time)", - "Mon, 02 Jan 2006 15:04:05 -0700", "12 Feb 2006, 19:17", "2015-02-18 00:12:00 +0000 GMT", "2015-02-18 00:12:00 +0000 UTC", @@ -44,10 +45,12 @@ var examples = []string{ "2014/4/02 03:00:51", "2012/03/19 10:11:59", "2012/03/19 10:11:59.3186369", - // yyyy-mm-dd + // yyyy-mm-ddT "2009-08-12T22:15:09-07:00", "2009-08-12T22:15:09Z", "2009-08-12T22:15:09", + "2006-01-02T15:04:05+0000", + // yyyy-mm-dd hh:mm:ss "2014-04-26 17:24:37.3186369", "2014-04-26 17:24:37.318636", "2012-08-03 18:31:59.257000000 +0000 UTC", @@ -76,10 +79,7 @@ func main() { table.AddHeaders("Input", "Parsed, and Output as %v") for _, dateExample := range examples { - t, err := dateparse.ParseAny(dateExample) - if err != nil { - panic(err.Error()) - } + t := dateparse.MustParse(dateExample) table.AddRow(dateExample, fmt.Sprintf("%v", t)) } fmt.Println(table.Render()) @@ -95,9 +95,10 @@ func main() { | Mon Jan 02 15:04:05 -0700 2006 | 2006-01-02 15:04:05 -0700 -0700 | | Monday, 02-Jan-06 15:04:05 MST | 2006-01-02 15:04:05 +0000 MST | | Mon, 02 Jan 2006 15:04:05 MST | 2006-01-02 15:04:05 +0000 MST | +| Tue, 11 Jul 2017 16:28:13 +0200 (CEST) | 2017-07-11 16:28:13 +0200 +0200 | +| Mon, 02 Jan 2006 15:04:05 -0700 | 2006-01-02 15:04:05 -0700 -0700 | | Mon Aug 10 15:44:11 UTC+0100 2015 | 2015-08-10 15:44:11 +0000 UTC | | Fri Jul 03 2015 18:04:07 GMT+0100 (GMT Daylight Time) | 2015-07-03 18:04:07 +0100 GMT | -| Mon, 02 Jan 2006 15:04:05 -0700 | 2006-01-02 15:04:05 -0700 -0700 | | 12 Feb 2006, 19:17 | 2006-02-12 19:17:00 +0000 UTC | | 2015-02-18 00:12:00 +0000 GMT | 2015-02-18 00:12:00 +0000 +0000 | | 2015-02-18 00:12:00 +0000 UTC | 2015-02-18 00:12:00 +0000 +0000 | @@ -127,6 +128,7 @@ func main() { | 2009-08-12T22:15:09-07:00 | 2009-08-12 22:15:09 -0700 PDT | | 2009-08-12T22:15:09Z | 2009-08-12 22:15:09 +0000 UTC | | 2009-08-12T22:15:09 | 2009-08-12 22:15:09 +0000 UTC | +| 2006-01-02T15:04:05+0000 | 2006-01-02 15:04:05 +0000 +0000 | | 2014-04-26 17:24:37.3186369 | 2014-04-26 17:24:37.3186369 +0000 UTC | | 2014-04-26 17:24:37.318636 | 2014-04-26 17:24:37.318636 +0000 UTC | | 2012-08-03 18:31:59.257000000 +0000 UTC | 2012-08-03 18:31:59.257 +0000 +0000 |