An open API service indexing awesome lists of open source software.

https://github.com/serhiicho/timeago

Date and time library for your Go project that converts dates into 'time ago' format
https://github.com/serhiicho/timeago

datetime datetime-converter datetime-formatters go go-package golang time timeago timeago-go

Last synced: 10 days ago
JSON representation

Date and time library for your Go project that converts dates into 'time ago' format

Awesome Lists containing this project

README

        

![golang](https://serhii.io/storage/other/timeago.png)

[![Go](https://github.com/SerhiiCho/timeago/actions/workflows/go.yml/badge.svg)](https://github.com/SerhiiCho/timeago/actions/workflows/go.yml)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FSerhiiCho%2Ftimeago%2Fbadge%3Fref%3Dmaster&style=flat)](https://actions-badge.atrox.dev/SerhiiCho/timeago/goto?ref=master)
[![Build Status](https://scrutinizer-ci.com/g/SerhiiCho/timeago/badges/build.png?b=master)](https://scrutinizer-ci.com/g/SerhiiCho/timeago/build-status/master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/SerhiiCho/timeago/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/SerhiiCho/timeago/?branch=master)
[![GitHub](https://img.shields.io/github/license/SerhiiCho/timeago)](https://github.com/SerhiiCho/timeago/blob/master/LICENSE.md)

Timeago is a fast and lightweight date time package that converts given date into human readable "n time ago" format in different languages, such as πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡ΊπŸ‡¦ πŸ‡³πŸ‡± πŸ‡©πŸ‡ͺ πŸ‡¨πŸ‡³ πŸ‡§πŸ‡Ύ πŸ‡ͺπŸ‡Έ πŸ‡―πŸ‡΅ πŸ‡«πŸ‡·. For more information you can read the [documentation](https://time-ago.github.io/).

### Follow the [Official documentation](https://time-ago.github.io/) for all the details
- [πŸ—’ Documentation](https://time-ago.github.io/)
- [πŸ—’ Release notes](https://github.com/SerhiiCho/timeago/blob/master/CHANGELOG.md)

## Quick Start
```bash
go get github.com/SerhiiCho/timeago/v3
```

## Codebase naming
Here are some of the naming conventions used in the codebase and their meanings for better understanding:

- **time unit** - a single time unit like `second`, `seconds`, `minute`, `minutes`, etc.
- **time number** - a number of time units like `1`, `2`, `3`, etc. in a string like `1 minute ago`, `2 minutes ago`, `3 minutes ago`, etc.
- **suffix** - the suffix `ago` in the final output like `1 minute ago`, `2 minutes ago`, `3 minutes ago`, etc.
- **time since** - the final output result like `2 minutes`, `3 minutes ago`, `Just now`, `Online`, `3 years ago` etc.

## License
This project is open-sourced software licensed under the [MIT license](https://github.com/SerhiiCho/timeago/blob/master/LICENSE.md).