refactor strToDate