【发布时间】:2014-04-14 18:59:01
【问题描述】:
我一直在尝试从08:00:00 UTC to 8:00 转换
通过使用 strftime
这是带有字段的 Profile 模型。
class Profile < ActiveRecord::Base
attr_accessible :sun, :mon, :wed, :tue, :thu, :fri, :sat
end
这是查询。
Profile.select('mon, tue, wed, thu, fri, sat, sun').where('usermodel_id = ?', 3).strftime('%H:%M')
错误:
NoMethodError: undefined method `strftime'
请你帮我转换格式:就像这样 周日:9:00,周一:9:00 等
我真的需要一些帮助,拜托
【问题讨论】:
标签: ruby-on-rails rails-activerecord strftime