Hi
I have this controller:
class SchedulesController "post", :except => :index
def index
#Schedules.create(:id => -1, :deviceId => "2002", :subject => "Test 2", :scheduleTime => Time.new, :repeatEveryYear => "FALSE")
#@schedules = Schedules.all
respond_to do |format|
format.html # list.html.erb
format.json { render :json => @schedules.to_json }
end
end
def create
@schedule = Schedules.new.from_json(params[:schedule])
@schedule.save
render :json => "success"
end
end
The Schedule has a dateTime field, how can I get the controller to return this time formatted as "yyyy-MM-dd HH:mm:zzzz" (zzzz = Specific GMT timezone)?
Thank you Søren