Description
A tiny date object in Go. Tinydate uses 4 bytes of memory vs the 24 bytes of a standard time.Time{}
A tinydate only has day precision. It has no knowledge of hours, minutes, seconds, or timezones.
go-tinydate alternatives and similar packages
Based on the "Natural Language Processing" category.
Alternatively, view go-tinydate alternatives based on common mentions on social networks and blogs.
-
prose
DISCONTINUED. :book: A Golang library for text processing, including tokenization, part-of-speech tagging, and named-entity extraction. -
gse
Go efficient multilingual NLP and text segmentation; support English, Chinese, Japanese and others. -
universal-translator
:speech_balloon: i18n Translator for Go/Golang using CLDR data + pluralization rules -
locales
:earth_americas: a set of locales generated from the CLDR Project which can be used independently or within an i18n package; these were built for use with, but not exclusive to https://github.com/go-playground/universal-translator -
go-nlp
DISCONTINUED. Utilities for working with discrete probability distributions and other tools useful for doing NLP work. -
segment
A Go library for performing Unicode Text Segmentation as described in Unicode Standard Annex #29 -
go-localize
i18n (Internationalization and localization) engine written in Go, used for translating locale strings. -
gotokenizer
A tokenizer based on the dictionary and Bigram language models for Go. (Now only support chinese segmentation)
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of go-tinydate or a related project?
Popular Comparisons
README
go-tinydate
A tiny date object in Go. Tinydate uses 4 bytes of memory vs the 24 bytes of a standard time.Time{}
A tinydate only has day precision. It has no knowledge of hours, minutes, seconds, or timezones.
⚙️ Installation
go get github.com/wagslane/go-tinydate
🚀 Quick Start
package main
import (
tinydate "github.com/wagslane/go-tinydate"
)
func main(){
td, err := tinydate.New(2020, 04, 3)
if err != nil {
fmt.Println(err.Error())
}
td = td.Add(time.Hour * 48)
fmt.Println(td)
// prints 2020-04-05
}
Need Second Precision? Go-TinyTime
I've had people ask why go-tinydate doesn't use unix time as the underlying data, rather than day-month-year. Day-month-year supports dates from year
0
to year 65535
. Unix timestamps only supports dates from 1970
to 2106
. If you need more precision, take a look at go-tinytime which
uses unix
time underneath and supports second precision.
Why?
If you don't have resource constraints, then don't use tinydate! Use the standard time pacakge.
go-tinydate works well in the following situations:
- You are working in embedded systems where memory is a luxury
- You are storing many dates and smaller memory footprint is desired
- You are 101% sure you don't need more than date precision
Example:
I needed to store many thousands of dates in memory in order to keep track of which IDs I had seen in the last X number of days. As such, I had a giant map[int]time.Time
. Switching from map[int]time.Time
to map[int]tinydate.TinyDate
reduced my program's memory from an average ~1GB to ~200MB.
💬 Contact
Submit an issue (above in the issues tab)
API
Godoc: https://godoc.org/github.com/wagslane/go-tinydate
Tinydate mirrors the time.Time API for the most part. The only methods that are not included are the ones that makes no sense with only day precision, or without timezones apart from UTC.
Formatting
All formatting is done via the time.Time package's formatting capabilites, but anything besides date data will be zeroed out for obvious reasons.
Transient Dependencies
None! And it will stay that way, except of course for the standard library.
Note: Currently the testify package is used only for testing, but that dependency will be removed in coming updates.
👏 Contributing
I love help! Contribute by forking the repo and opening pull requests. Please ensure that your code passes the existing tests and linting, and write tests to test your changes if applicable.
All pull requests should be submitted to the "master" branch.
go test
go fmt