Converts seconds like 7261 into a human readable string '2h1m1s'.
Also can parse that format back to integer seconds.
Add this line to your application's Gemfile:
gem 'human_seconds'
And then execute:
$ bundle
Or install it yourself as:
$ gem install human_seconds
hs = HumanSeconds.new(61)
hs.to_i #=> 61
hs.to_s #=> 1m1s
HumanSeconds.parse('1m1s').to_i # => 61
- Fork it ( http://github.com//human_seconds/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Make sure specs pass (
bundle exec rake spec
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request