A go package to parse human-readble date and time strings
Go
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE Doh. missing license Oct 1, 2014
README.md
date.go
date_parse.go
datetime.go
doc.go
examples_test.go
fuzzy.go
fuzzy_test.go
lookups.go add timezone parsing. simplify test data Apr 11, 2014
span.go extend datetime Extract() to return spans and err Sep 9, 2014
time.go
time_parse.go
tz.go add some more docs Jul 6, 2014

README.md

fuzzytime

A date/time parsing package for Go.

Documentation: GoDoc

Example:

func ExampleExtract() {

inputs := []string{
"Wed Apr 16 17:32:51 NZST 2014",
"2010-02-01T13:14:43Z", // an iso 8601 form
"no date or time info here",
"Published on March 10th, 1999 by Brian Credability",
"2:51pm",
}

for _, inp := range inputs {
dt := Extract(inp)
fmt.Println(dt.ISOFormat())
}

// Output:
// 2014-04-16T17:32:51+12:00
// 2010-02-01T13:14:43Z
//
// 1999-03-10
// T14:51
}