Convert time strings to milliseconds