DB:Ruby: convert Time to integer to store in DB