Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waterlink/timestamp.cr
Timestamps in crystal-lang. Adds `.from_timestamp` and `#to_timestamp` methods to `Time`
https://github.com/waterlink/timestamp.cr
Last synced: 30 days ago
JSON representation
Timestamps in crystal-lang. Adds `.from_timestamp` and `#to_timestamp` methods to `Time`
- Host: GitHub
- URL: https://github.com/waterlink/timestamp.cr
- Owner: waterlink
- License: mit
- Created: 2015-03-22T16:27:46.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-22T17:16:57.000Z (almost 10 years ago)
- Last Synced: 2024-10-16T07:16:08.799Z (3 months ago)
- Language: Crystal
- Homepage:
- Size: 121 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# timestamp.cr
Timestamp implementation for crystal-lang.
## Installation
Add it to your `Projectfile`
```crystal
deps do
github "waterlink/timestamp.cr"
end
```## Usage
```crystal
require "timestamp"
```### Create `Time` from timestamp:
```crystal
puts Time.from_timestamp(1427042133.035) #=> 2015-03-22 16:35:33
```### Get timestamp from `Time` instance:
```crystal
puts Time.now.to_timestamp #=> 1427042133.035
```## Contributing
1. Fork it ( https://github.com/waterlink/timestamp.cr/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request## Contributors
- [waterlink](https://github.com/waterlink) - creator, maintainer