Human kindly date-time library for go.
kindlytime
is date-time library for go.
import (
"github.com/yamaya/kindlytime"
"fmt"
)
jst, _ := time.LoadLocation("Asia/Tokyo")
origin := time.Date(2016, 12, 30, 0, 0, 0, 0, jst)
result := kindlytime.Parse("2 days ago", origin)
// 2016-12-28 00:00:00
go 1.8.3
$ go get github.com/yamaya/kindlytime
- Convert time.Time object to kindlytime string
- Localization
- Test! Test! Test!