# File app/models/timeslot.rb, line 100 def time_to_start total = seconds_to_start direction = total < 0 ? '-' : '' total = total.abs days = (total / 86400).to_i days = '' if days == 0 # Ugly, but more readable in the end :-/ hours = (total % 86400) / 3600 minutes = (total % 3600) / 60 seconds = total % 60 '%s%s %02d:%02d:%02d' % [direction, days, hours, minutes, seconds] end