How to convert date to timestamp and timestamp to date in ruby on rails?

    You can do this simply
    #date to timestamp

    start_date = DateTime.now

    timestamp = start_date.to_time_to_i

    #Timestamp to date again

    start_date_again = Time.at(timestamp)
    0