Catch invalid time values, set default value for decimal places
differently only when the min. time unit are seconds and remove trailing
spaces