Samay is a date/time manipulation library built in GoLang. It uses a fluent API and provides functions for
- Date time Formatting
- Rounding of date and time
- Addition of date time
- Subtraction of date time
- Difference between different date time
- Formatters for date time
- Comparison of date times
Create a new instance using one of the two methods
samay.Create(time Time)
samay.CreateFromFormat(time.FormatANSIC, '25/12/14')
Samay's fluent APIs can be utilised by stacking on function calls to get the desired output.
samay.Create(time Time).EndOfDay().AddWeeks(2).FormatANSIC()
samay.Create(time Time).AddDays(12).GreaterThan(time1 Time)
- Functions which return
Samay
object can be used to chain method calls. - Functions such as
FormatXYZ
will return string and cannot be chained. - Function such as
GreaterThan
will return boolean and cannot be chained.