
November 17th, 2009, 09:16 AM
|
|
Contributing User
|
|
Join Date: Jan 2004
Location: Constant Limbo
|
|
Code:
def seconds_minutes_string(seconds_elapsed)
return '0.00'
end
Has the same effect as
On top of that, it seems (from the absolutely minimal amount of information you provide) that you wish to manage time through string manipulation. Ruby has a very rich set of time functionalities wrapped up in the Time object. Consider the following:
Code:
t = Time.now # => Tue Nov 17 10:11:18 -0500 2009
# wait a bit
u = Time.now # => Tue Nov 17 10:11:54 -0500 2009
u - t # => 35.672565
(u - t).to_s # => "35.672565"
You can use TIme objects as 'first-class' objects so to speak; they can be added, subtracted, etc...
__________________
True happiness is not getting what you want, it's wanting what you've already got.
My Blog
|