Skip to content

Instantly share code, notes, and snippets.

@cjbottaro
Created April 23, 2009 03:20
Show Gist options
  • Save cjbottaro/100273 to your computer and use it in GitHub Desktop.
Save cjbottaro/100273 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'activesupport'
dt = DateTime.now
puts dt.utc.to_f
# => 1240456717.12572
puts dt.to_time.to_f
# => 1240456717.12572
puts dt.utc.to_time.to_f
# => 1240455680.0
puts dt.to_time.utc.to_f
# => 1240456717.12572
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment