On 10/10/2012 06:00 PM, Todd Benson wrote:
> def ptime sec
>   ground, sec = Time.new(2012, 1, 1, 0, 0), sec.abs
>   return sec.abs > 86400 ? nil : (ground + sec).strftime("%T")
> end

Using modulo and default arguments, this can be simplified quite a bit:

def ptime sec
   (Time.new(1) + sec % 86400).strftime "%T"
end

-- 
Lars Haugseth