Convert time to long.