In Python3, I receive the following error message:
ValueError: time data '\u200e07-30-200702:38 PM' does not match format '%m-%d-%Y%I:%M %p'
from datetime import datetime
dateRegistered = '\u200e07-30-200702:38 PM'
# dateRegistered = '07-30-200702:38 PM'
dateRegistered = datetime.strptime(dateRegistered, '%m-%d-%Y%I:%M %p')
print (dateRegistered)
The code above serves to replicate the issue. It works if I uncomment the line. It seems the string I am receiving is encoded, but I could not find out which encoding it is using. Or do I have a non-printable character in my string?
print ('\u200e07-30-200702:38 PM')
>>>> 07-30-200702:38 PM