https://github.com/gomodules/date
A Go package for working with dates
https://github.com/gomodules/date
Last synced: 5 months ago
JSON representation
A Go package for working with dates
- Host: GitHub
- URL: https://github.com/gomodules/date
- Owner: gomodules
- License: bsd-3-clause
- Fork: true (rickb777/date)
- Created: 2020-10-21T08:19:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-16T00:47:44.000Z (over 5 years ago)
- Last Synced: 2024-06-20T13:36:03.295Z (almost 2 years ago)
- Homepage: https://godoc.org/github.com/rickb777/date
- Size: 353 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# date
[](https://pkg.go.dev/github.com/rickb777/date)
[](https://travis-ci.org/rickb777/date/builds)
[](https://coveralls.io/github/rickb777/date?branch=master)
[](https://goreportcard.com/report/github.com/rickb777/date)
[](https://github.com/rickb777/date/issues)
Package `date` provides functionality for working with dates.
This package introduces a light-weight `Date` type that is storage-efficient
and convenient for calendrical calculations and date parsing and formatting
(including years outside the [0,9999] interval).
It also provides
* `clock.Clock` which expresses a wall-clock style hours-minutes-seconds with millisecond precision.
* `period.Period` which expresses a period corresponding to the ISO-8601 form (e.g. "PT30S").
* `timespan.DateRange` which expresses a period between two dates.
* `timespan.TimeSpan` which expresses a duration of time between two instants.
* `view.VDate` which wraps `Date` for use in templates etc.
See [package documentation](https://godoc.org/github.com/rickb777/date) for
full documentation and examples.
## Installation
go get -u github.com/rickb777/date
or
dep ensure -add github.com/rickb777/date
## Status
This library has been in reliable production use for some time. Versioning follows the well-known semantic version pattern.
## Credits
This package follows very closely the design of package
[`time`](http://golang.org/pkg/time/) in the standard library;
many of the `Date` methods are implemented using the corresponding methods
of the `time.Time` type and much of the documentation is copied directly
from that package.
The original [Good Work](https://github.com/fxtlabs/date) on which this was
based was done by Filippo Tampieri at Fxtlabs.