Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shugo/beattime
Swatch Internet Time Library for Ruby
https://github.com/shugo/beattime
Last synced: about 1 month ago
JSON representation
Swatch Internet Time Library for Ruby
- Host: GitHub
- URL: https://github.com/shugo/beattime
- Owner: shugo
- License: mit
- Created: 2015-10-28T08:19:07.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-28T09:03:30.000Z (about 9 years ago)
- Last Synced: 2023-04-12T11:03:09.528Z (over 1 year ago)
- Language: Ruby
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# beattime
Swatch Internet Time Library for Ruby## Usage
### As a library
require "beattime"
using BeatTime
bt = Time.now.to_beat # convert a Time to a beat time represented by Rational
t = Time.from_beat(393.98) # convert a beat time to a Time
t = Time.parse_beat("@393.98") # parse a beat time### As a command
#### Print the current beat time
$ beattime.rb
@393.98#### Parse a beat time, and print it in ISO 8601 format
$ beattime.rb @393.98
17:27:19#### Most useful usage
$ beattime.rb `beattime.rb`
17:27:19