title: Python how to convert string with special character into datetime
body: <p>Trying to convert a string to datetime:</p>
  <pre><code>from datetime import datetime
  
  date_string = &quot;2021-07-07T02:27:00Z&quot;
  
  datetime.strptime('2021-07-07T02:27:00Z', '%Y-%M-%d %H:%M:%S')
  
  
  Error:
  error: redefinition of group name 'M' as group 5; was group 2 at position 107
  </code></pre>
  <p>Any then I tried:</p>
  <pre><code>datetime.fromisoformat(date_string)
  </code></pre>
  <p>Still not working.</p>
  <p>Any friend can help?</p>