I have a timestamp that is in UTC
\"2010-10-25 23:48:46 UTC\"
I need to convert it into ISO 8601
\"2010-10-29 06:09Z\"
The documentation is
Adding an answer to this super old question because if you're using Rails, there is no need to convert/parse it in the way the other answers here are telling you to do:
created_at or updated_at attribute), you can directly call the iso8601 method on that timestamp (e.g., object.created_at.iso8601). iso8601 method also accepts a numeric argument to display fractional digits; you would use this if you want 2020-04-06T19:16:55.604Z instead of 2020-04-06T19:16:55Z.https://api.rubyonrails.org/v5.2.4/classes/ActiveSupport/TimeWithZone.html#method-i-iso8601