Abhi On Rails

Ruby On Rails - What I learned recently

time_diff - a gem for calculating the difference between two TIME

Yesterday I created a gem for calculating the difference between two TIME.

When I was working in my office, we found that there is no method to extract the difference between two Time in a useful format like years, month, week, day, hour, minute and second.

time1 - time2 return only difference inseconds.

So I created this gem time_diff which return the hash with difference:

{ :year => 0, :month => 0, :day => 0, :week => 0, :hour => 0, :minute => 0, :second => 0 }

blog comments powered by Disqus
Create ruby gem using Jeweler →
← State Machine