Skip to content

Instantly share code, notes, and snippets.

@cjbottaro
Created April 23, 2009 02:58
Show Gist options
  • Save cjbottaro/100257 to your computer and use it in GitHub Desktop.
Save cjbottaro/100257 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'activesupport'
dt = DateTime.now
puts dt.to_f
# => 1240455468.91318
t = YAML.load(dt.to_yaml)
puts t.class.name
# => Time
puts t.to_f
# => 1240455468.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment