Use strptime in str2datetime for better validation