A small golang library to make calculation of time duration easier
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.coveralls.yml
.gitignore
.travis.yml
LICENSE
README.md
timeago.go
timeago_test.go

README.md

timeago

Build Status Coverage Status

TimeAgo is a library used to calculate how much time has been passed between two dates, this library is mainly based on time type of go.

Example

import (
  "fmt"
  "time"
  timeago "github.com/ararog/timeago"
)

d, _ := time.ParseDuration("-3h")
start := time.Now()
end := time.Now().Add(d)
got, _ := timeago.TimeAgoWithTime(start, end)
fmt.Printf("Output: %s\n", got)