Forum: Ruby on Rails Re: Time from seconds.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
364025223fa593e2e76111b31d76f406?d=identicon&s=25 Piet Hadermann (piet)
on 2007-07-31 17:07
(Received via mailing list)
Something like:

def number_to_time(seconds)
  Time.at(seconds.to_i-3600).strftime("%H:%M:%S")
end

Piet.
A74dc73058b049832872a74a066669eb?d=identicon&s=25 tobyclemson@gmail.com (Guest)
on 2007-07-31 17:51
(Received via mailing list)
Well it would be really nice and concise if that worked but
unfortunately it doesn't work for seconds > 1.day i.e., it will show
00:05:55 rather than 24:05:55.
I would like a %H:%M:%S type output but with %H representing the
number of hours which can be greater than 24.

On Jul 31, 4:07 pm, "Piet Hadermann" <piet.haderm...@seagha.com>
This topic is locked and can not be replied to.