35👍
✅
You can parse the microseconds:
from datetime import datetime
date_posted = '2014-01-15T01:35:30.314Z'
datetime.strptime(date_posted, '%Y-%m-%dT%H:%M:%S.%fZ')
12👍
One option is to let dateutil do the job:
>>> from dateutil import parser
>>> parser.parse('2014-01-15T01:35:30.314Z')
datetime.datetime(2014, 1, 15, 1, 35, 30, 314000, tzinfo=tzutc())
- Show images in Django templates
- 'Questions ' object is not iterable Django
- How can I disable a model field in a django form
- Remove padding from matplotlib plotting
Source:stackexchange.com