tamalw (owner)

Revisions

  • 6c490c firblitz Mon Jul 28 13:23:12 -0700 2008
  • 879194 firblitz Mon Jul 28 13:04:52 -0700 2008
gist: 2945 Download_button fork
public
Public Clone URL: git://gist.github.com/2945.git
Embed All Files: show embed
Text #
1
2
3
4
5
6
7
8
9
10
11
require 'date'
 
class DateTime
  def to_f
    days_since_unix_epoch = self - ::DateTime.civil(1970)
    (days_since_unix_epoch * 86_400).to_f
  end
end
 
foo = DateTime.now
puts foo.to_f