Parse In Location api

This commit is contained in:
Aaron Raddon
2017-07-26 16:42:12 -07:00
parent fbbaa2aade
commit 0e522cd409
3 changed files with 164 additions and 85 deletions

View File

@@ -8,7 +8,20 @@ Parse any date string without knowing format in advance. Uses a scanner to read
**Timezones** The location your server is configured effects the results! See example or https://play.golang.org/p/IDHRalIyXh and last paragraph here https://golang.org/pkg/time/#Parse.
See example https://github.com/araddon/dateparse/blob/master/example/main.go
```go
// Normal parse
t, err := dateparse.ParseAny("3/1/2014")
// Parse with Location
denverLoc, _ := time.LoadLocation("America/Denver")
t, err := dateparse.ParseIn("3/1/2014", denverLoc)
```
Extended example https://github.com/araddon/dateparse/blob/master/example/main.go
```go
package main