0
我有以下情況。一個用戶從軌道的日期和時間選擇框,並在控制器中的日期和時間,方法創造,我有以下PARAMS:Datetime從參數未正確保存在數據庫中
"event"=>
{"title"=>"tet",
"start_date(1i)"=>"2013",
"start_date(2i)"=>"4",
"start_date(3i)"=>"26",
"end_date(1i)"=>"2013",
"end_date(2i)"=>"4",
"end_date(3i)"=>"31",
"start_time(1i)"=>"2013",
"start_time(2i)"=>"4",
"start_time(3i)"=>"26",
"start_time(4i)"=>"10",
"start_time(5i)"=>"05",
"end_time(1i)"=>"2013",
"end_time(2i)"=>"4",
"end_time(3i)"=>"26",
"end_time(4i)"=>"10",
"end_time(5i)"=>"05"}
,如果我做
@event = Event.new(params[:event])
輸出
=> #<Event id: nil, start_date: "2013-04-26", title: "tet", created_at: nil, updated_at: nil, owner_id: 0, owner_type: "", archived: false, end_date: "2013-05-01", start_time: "2013-04-26 10:05:00", end_time: "2013-04-26 10:05:00">
的END_DATE不與一個在PARAMS同一
個Time.zone
回報
=>(GMT + 02:00)耶路撒冷
爲什麼會出現這種情況?
哇,它看起來像你說的沒錯:d,所以它的軌道的錯:-s – vladCovaliov 2013-04-26 07:28:14