Sha256: b76257134e542b843b23f69473d64e721b0f7ccef19d743ca6814652ddac75c4

Contents?: true

Size: 406 Bytes

Versions: 28

Compression:

Stored size: 406 Bytes

Contents

class TimepieceController < ApplicationController

  respond_to :json

  def clock
    arr = Array.new
    params[:timezones].each_with_index do | data, index |
    	zone = Time.now.in_time_zone(data)
      time = {
        :hours => zone.strftime('%H'),
        :minutes => zone.strftime('%M'),
        :seconds => zone.strftime('%S') 
      }
      arr << time
    end
    render :json => arr
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
timepiece-0.2.11 app/controllers/timepiece_controller.rb
timepiece-0.2.10 app/controllers/timepiece_controller.rb
timepiece-0.2.9 app/controllers/timepiece_controller.rb
timepiece-0.2.8 app/controllers/timepiece_controller.rb
timepiece-0.2.7 app/controllers/timepiece_controller.rb
timepiece-0.2.6 app/controllers/timepiece_controller.rb
timepiece-0.2.5 app/controllers/timepiece_controller.rb
timepiece-0.2.4 app/controllers/timepiece_controller.rb
timepiece-0.2.3 app/controllers/timepiece_controller.rb
timepiece-0.2.2 app/controllers/timepiece_controller.rb
timepiece-0.2.1 app/controllers/timepiece_controller.rb
timepiece-0.2.0 app/controllers/timepiece_controller.rb
timepiece-0.1.15 app/controllers/timepiece_controller.rb
timepiece-0.1.14 app/controllers/timepiece_controller.rb
timepiece-0.1.13 app/controllers/timepiece_controller.rb
timepiece-0.1.12 app/controllers/timepiece_controller.rb
timepiece-0.1.11 app/controllers/timepiece_controller.rb
timepiece-0.1.10 app/controllers/timepiece_controller.rb
timepiece-0.1.9 app/controllers/timepiece_controller.rb
timepiece-0.1.8 app/controllers/timepiece_controller.rb