TimeMath

TimeMath - Computation Helper for Rails Time Formats

Installation

Add this line to your application's Gemfile:

gem 'time_math'

And then execute:

$ bundle

Or install it yourself as:

$ gem install time_math

Usage

For "strftime" format:

SUM:
    TimeMath.strftime(time_a, time_b).sum

DIFFERENCE:
    TimeMath.strftime(time_a, time_b).diff

For "original" format:

    DIFFERENCE:
        TimeMath.realtime(time_a, time_b).diff

Usage in irb

require 'time_math'

For "strftime" format:

    SUM:
        TimeMath.strftime(time_a, time_b).sum

    DIFFERENCE:
        TimeMath.strftime(time_a, time_b).diff

For "original" format:

        DIFFERENCE:
            TimeMath.realtime(time_a, time_b).diff

Author

By: Oliver Jesus De Quintos On: December 2015

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request