https://github.com/caarlos0/timea.go
timea.go (did you see what I did there?) is a simple library to print given times in "time ago" manner.
https://github.com/caarlos0/timea.go
golang golang-library time
Last synced: 2 months ago
JSON representation
timea.go (did you see what I did there?) is a simple library to print given times in "time ago" manner.
- Host: GitHub
- URL: https://github.com/caarlos0/timea.go
- Owner: caarlos0
- License: mit
- Created: 2021-08-14T23:22:39.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-18T22:51:19.000Z (8 months ago)
- Last Synced: 2025-03-31T01:31:58.589Z (3 months ago)
- Topics: golang, golang-library, time
- Language: Go
- Homepage:
- Size: 43 KB
- Stars: 47
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# timea.go
[](https://github.com/caarlos0/timea.go/actions?workflow=build)
[](https://codecov.io/gh/caarlos0/timea.go)
[](https://pkg.go.dev/github.com/caarlos0/timea.go)`timea.go` (_did you see what I did there?_) is a simple and 0-dependencies
library to print given times in "time ago" manner.## Usage
Get it:
```sh
go get github.com/caarlos0/timea.go
```Use it:
```go
package mainimport (
"fmt"
"time"timeago "github.com/caarlos0/timea.go"
)func main() {
fmt.Println(timeago.Of(time.Now().Add(-5 * time.Second))) // 5 seconds ago
fmt.Println(timeago.Of(time.Now().Add(5 * time.Second))) // 5 seconds from now
}
```You may also check the [go docs](https://pkg.go.dev/github.com/caarlos0/timea.go)
for advanced usage, like custom precision and string templates.## Stargazers over time
[](https://starchart.cc/caarlos0/timea.go)