Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skull-squadron/tai
TAI time library for Crystal with leap-second corrections
https://github.com/skull-squadron/tai
crystal crystal-lang crystal-language date iso8601 tai tai64 tai64n time
Last synced: 24 days ago
JSON representation
TAI time library for Crystal with leap-second corrections
- Host: GitHub
- URL: https://github.com/skull-squadron/tai
- Owner: skull-squadron
- License: mit
- Created: 2023-05-01T04:11:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-01T05:53:05.000Z (over 1 year ago)
- Last Synced: 2024-10-25T01:23:57.356Z (2 months ago)
- Topics: crystal, crystal-lang, crystal-language, date, iso8601, tai, tai64, tai64n, time
- Language: Crystal
- Homepage: https://steakknife.github.io/tai/
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![tag](https://img.shields.io/github/v/tag/steakknife/tai)
![license](https://img.shields.io/github/license/steakknife/tai)
![issues](https://img.shields.io/github/issues/steakknife/tai)
![build](https://img.shields.io/github/actions/workflow/status/steakknife/tai/crystal.yml)# TAI for Crystal
## Purpose
Monotonic time that never needs leapseconds
## Usage
### Time To TAI64
`your_time.to_tai64`
### Time To TAI64N
`your_time.to_tai64n`
### TAI64N to Time
`your_tai64n.to_time`
### TAI64NA to Time
`your_tai64na.to_time`
### Live self-update (non-persistent) of leapsecond data
`Time.tai_update_leap_sec_tables!`
`Time.tai_update_leap_sec_tables!("https://your.server/path/here")`## Installation
Add to `shard.yml`
```yaml
dependencies:
tai:
github: steakknife/tai
version: ~> 0.1.0
```## [Documentation](https://steakknife.github.io/tai/)
### Local documentation
```
make doc # creates ./docs
```## Test
```
git clone https://github.com/steakknife/tai
cd tai
make check
```## License
MIT