from datetime import datetime
gagarin = 'April 12, 1961 6:07 local time'
dt = datetime.strptime(gagarin, '%B %d, %Y %H:%M local time')
formatted = dt.strftime('%Y-%m-%dT%H:%M:%S.%fZ')
print(formatted)

53555a85b12492fbecef72b74da4b8e314c35d76
<mask token>

<mask token>
print(formatted)

<mask token>
gagarin = 'April 12, 1961 6:07 local time'
dt = datetime.strptime(gagarin, '%B %d, %Y %H:%M local time')
formatted = dt.strftime('%Y-%m-%dT%H:%M:%S.%fZ')
print(formatted)

from datetime import datetime
gagarin = 'April 12, 1961 6:07 local time'
dt = datetime.strptime(gagarin, '%B %d, %Y %H:%M local time')
formatted = dt.strftime('%Y-%m-%dT%H:%M:%S.%fZ')
print(formatted)
