parse strict refs #28

This commit is contained in:
Aaron Raddon
2018-03-24 17:49:27 -07:00
parent 934b3f146d
commit fd8f11d211
5 changed files with 169 additions and 70 deletions

View File

@@ -19,6 +19,10 @@ Parse many date strings without knowing format in advance. Uses a scanner to re
// Normal parse. Equivalent Timezone rules as time.Parse()
t, err := dateparse.ParseAny("3/1/2014")
// Parse Strict, error on ambigous mm/dd vs dd/mm dates
t, err := dateparse.ParseStrict("3/1/2014")
> returns error
// Parse with Location, equivalent to time.ParseInLocation() timezone/offset
// rules. Using location arg, if timezone/offset info exists in the
// datestring, it uses the given location rules for any zone interpretation.