I\'ve got code that does time tracking for employees. It creates a counter to show the employee how long they have been clocked in for.
This is the current code:
there's a method made for that:
Time.now.minus_with_coercion(10.seconds.ago)
equals 10.
Source: http://apidock.com/rails/Time/minus_with_coercion
Hope I helped.