convert time to integer