You can use the ActiveSupport
Date
functions #beginning_of_day
and #end_of_day
. And use to_i
to convert the time to seconds since Epoch.
require 'active_support/core_ext'
Date.today.beginning_of_day.to_i
# => 1395532800
Date.today.end_of_day.to_i
# => 1395619199