I'm trying to convert the standard rails DB fields created_at and updated_at into the atom feed rfc3339 format. So far I have tried:
DateTime.rfc3339(issue.updated_at)
and
DateTime.parse(issue.updated_at).rfc3339
and both times I get:
no implicit conversion of ActiveSupport::TimeWithZone into String
If I try and validate my atom feed at w3.org I get the following message:
updated must be an RFC-3339 date-time: 2013-06-27 13:42:34 UTC
The above error is for all the database updated_at fields. When I create the feed updated at field like the following I get no error:
xml.updated(Time.now.xmlschema)
I've searched high and low without fixing this issue. I did find Convert db date to rfc3339 but that didn't work for me.
Any ideas?
Try:
issue.updated_at.to_datetime.rfc3339
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With