Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

date class to unix timestamp ruby

>> Date.new(2009,11,26).to_time
=> Thu Nov 26 00:00:00 -0800 2009
>> Date.new(2009,11,26).to_time.to_i
=> 1259222400
>> Time.at(1259222400)
=> Thu Nov 26 00:00:00 -0800 2009
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #date #class #unix #timestamp #ruby
ADD COMMENT
Topic
Name
2+5 =