Skip to content

Instantly share code, notes, and snippets.

@fiddyspence
Created December 10, 2015 16:30
Show Gist options
  • Save fiddyspence/be3b200ed9be58bb90b7 to your computer and use it in GitHub Desktop.
Save fiddyspence/be3b200ed9be58bb90b7 to your computer and use it in GitHub Desktop.
irb(main):002:0> require 'time'
=> true
irb(main):003:0> foo = Time.parse(Time.now.iso8601(6))
=> Thu Dec 10 16:30:00 +0000 2015
irb(main):004:0> {1=> foo}.to_yaml
=> "--- \n1: 2015-12-10 16:30:00.669659 +00:00\n"
irb(main):005:0> ^Dspenceware:~ fids$ irb
spenceware:~ fids$
spenceware:~ fids$ 200
spenceware:~ fids$ irb
irb(main):001:0> foo = Time.parse(Time.now.iso8601(6))
=> 2015-12-10 16:30:59 +0000
irb(main):002:0> {1=> foo}.to_yaml
=> "---\n1: 2015-12-10 16:30:59.438986000 +00:00\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment