Ruby on rails Rails将更新的_at转换为rfc3339格式
我正在尝试将创建和更新的标准rails DB字段转换为atom提要rfc3339格式。到目前为止,我已经尝试:Ruby on rails Rails将更新的_at转换为rfc3339格式,ruby-on-rails,Ruby On Rails,我正在尝试将创建和更新的标准rails DB字段转换为atom提要rfc3339格式。到目前为止,我已经尝试: DateTime.rfc3339(issue.updated_at) 及 这两次我都得到: no implicit conversion of ActiveSupport::TimeWithZone into String 如果我尝试在w3.org验证atom提要,我会收到以下消息: updated must be an RFC-3339 date-time: 2013-06-27
DateTime.rfc3339(issue.updated_at)
及
这两次我都得到:
no implicit conversion of ActiveSupport::TimeWithZone into String
如果我尝试在w3.org验证atom提要,我会收到以下消息:
updated must be an RFC-3339 date-time: 2013-06-27 13:42:34 UTC
上述错误适用于所有更新的数据库字段。当我创建feed updated at字段时,如下所示,我没有得到任何错误:
xml.updated(Time.now.xmlschema)
我到处寻找,但没有解决这个问题。我确实找到了,但那对我不起作用
有什么想法吗?试试:
issue.updated_at.to_datetime.rfc3339
issue.updated_at.to_datetime.rfc3339