human readable time from seconds (helper)


/ Published in: Rails
Save to your folder(s)

A very concise ruby on rails helper method that converts seconds into human readable format. It will not display any time periods that have 0 (ie: 1 hour 13 seconds - skipping minutes as there were none) Due to complexity, months were not factored into this converter, the function will go from weeks to years. I welcome anyone that feels the urge to fork this with month's included. ;)

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.