So you want to generate ISO8601 formatted timestamps in Ruby, but need resolution finer than a second?
First, make sure to require 'time'
in order to get ISO8601 formatting. But that gets you this:
2.1.0 :001 > require 'time'
=> true
2.1.0 :002 > Time.now.utc.iso8601
=> "2015-11-12T04:46:43Z"
The round() method will get you finer resolution!
2.1.0 :003 > Time.now.utc.round(10).iso8601(6)
=> "2015-11-12T04:47:55.196329Z"
🎉 Thanks!