What is Timeago? β
Timeago is a fast and lightweight library for working with dates and times. It transforms a given date into a human-readable "time ago" format, calculating the difference between the specified date and the current date. It supports both past and future dates, making it versatile for various use cases.
With its simple API and support for multiple languages, Timeago seamlessly adapts to different applications, whether you're building user interfaces, handling localized content, or working with changing or real-time dates.
Features β
The library has several nice features, such as:
- π Flexible date parsing, supporting both past and future dates
- βοΈ Configurable library with ability to pass options to suit various use cases, override translations or modify the output format
- β Comprehensive test coverage for reliability
- π Timeago support multiple languages such as English, Russian, Ukrainian, Dutch, German, Chinese, Belarusian, Spanish and more. You can also easily contribute more following our step-by-step guide
- π¦ Compact codebase for minimal footprint
- π°οΈ Unix timestamp parsing
- β±οΈ Support for date-time strings in the
YYYY-MM-DD HH:MM:SS
format - π Compatibility with
time.Time
struct from the Go standard library - βοΈ Easy contribution of new language support
- π Detailed CHANGELOG.md for all updates and features
- π Thorough documentation for ease of use
Supported Languages β
Timeago supports multiple languages, and youβre welcome to contribute additional ones. Check out the languages currently available:
# | Flag | Language | ISO 639-1 Code | Const |
---|---|---|---|---|
1 | π¬π§ | English | en | timeago.LangEn |
2 | π·πΊ | Russian | ru | timeago.LangRu |
3 | πΊπ¦ | Ukrainian | uk | timeago.LangUk |
4 | π³π± | Dutch | nl | timeago.LangNl |
5 | π©πͺ | German | de | timeago.LangDe |
6 | π¨π³ | Chinese | zh | timeago.LangZh |
7 | π§πΎ | Belarusian | be | timeago.LangBe |
8 | πͺπΈ | Spanish | es | timeago.LangEs |
9 | π―π΅ | Japanese | ja | timeago.LangJa |
10 | π«π· | French | fr | timeago.LangFr |