python check if string has date format