lib/zklib/helper.rb
# Convert number of seconds to time
#
# param  options
#        |_ seconds  Time in seconds to decode
Convert number of seconds to time
param  options
|_ seconds  Time in seconds to decode
Convert number of seconds to time param options |_ seconds Time in seconds to decode
def decode_time(options)
      time = options[:seconds]
      second = time % 60
      time = (time - second) / 60
      minute = time % 60
      time = (time - minute) / 60
      hour = time % 24
      time = (time - hour) / 24
      day = time % 31 + 1
      time = (time - day + 1) / 31
      month = time % 12 + 1
      time = (time - month + 1) / 12
      year = time + 2000
      Time.new(year, month, day, hour, minute, second)
    end
def decode_time ( options ) time = options [ :seconds ] second = time % 60 time = ( time - second ) / 60 minute = time % 60 time = ( time - minute ) / 60 hour = time % 24 time = ( time - hour ) / 24 day = time % 31 + 1 time = ( time - day + 1 ) / 31 month = time % 12 + 1 time = ( time - month + 1 ) / 12 year = time + 2000 Time . new ( year , month , day , hour , minute , second ) end
Convert number of seconds to time
param  options
|_ seconds  Time in seconds to decode
Convert number of seconds to time param options |_ seconds Time in seconds to decode
# Calculate second value # Calculate minute value # Calculate hour value # Calculate day value # Calculate month value # Calculate year value
options