I have ann app that has a start_date and an end_date that is currently in the format Thu, 23 Apr 2015 17:00:00 UTC +00:00
and the field type is datetime.
I am needing to convert it into this YYYY-MM-DDThh:mm:ssZ
for the Eventbrite API but I am having little luck.
I have tried iso = Time.iso8601(start_date)
but I get the following error TypeError: no implicit conversion of ActiveSupport::TimeWithZone into String
Anyone able to point me in the right direction it would be very much appreciated.
try following:
start_date.iso8601
output
=> "2015-05-06T15:53:51+05:00"
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