Here's the code:
#!/usr/bin/env ruby

class S2hhmmss

  def to_hhmmss(duration)
	@duration = duration
	@t = @duration / 86400	# Number of days + fraction in interval.
	@DD = @t.to_i			# Remove fractional part of day.
	@t -= @DD				# Compute fractional part of day
	@hh = @t * 24			# Hours from fractional part of day.
	@mm = @hh- / hh.to_i*60 	# Compute minutes + fraction.
	@ss = @mm- / mm.to_i*60	# Compute seconds + fraction.
	printf ("%d days %02d:%02d:%02d\n",@DD,@hh,@mm,@ss)
  end

end
dl = Time.mktime(2004,5,18,0,0,0,0.0) - Time.now
puts dl.to_s
S2hhmmss.to_hhmmss(dl)
dl /= 86400
puts dl.to_i.to_s+' days until Teddy gets his learner\'s permit!'
puts dl.to_s+' days until Teddy gets his learner\'s permit!'

Here's what happens when I run it:
46480555.570496
/usr/local/bin/tttdl.rb:19: undefined method `to_hhmmss' for S2hhmmss:Class (NoMethodError)
46480541.596954

And... is there a more "Ruby-like" way to write it? (I don't even know
whether it works...)