Format a time with Ruby (on Rails)
Posted
by smotchkkiss
on Stack Overflow
See other posts from Stack Overflow
or by smotchkkiss
Published on 2010-03-17T23:53:35Z
Indexed on
2010/03/18
0:01 UTC
Read the original article
Hit count: 251
ruby-on-rails
|ruby
t = Time.now
d = 10.minutes.from_now
Using these two variables, how do I output a timer like 00:10:00?
As d counts down, the timer would show 00:09:59, 00:09:58, etc.
Note: I'd formatting uses Rails datetime format method somehow.
© Stack Overflow or respective owner