Reputation: 83697
So I have a string like this:
2012-01-01T00:00:00Z
Hopw can I transform it into an object I can save in my model, which has this field:
start_date = models.DateTimeField()
Upvotes: 2
Views: 122
Reputation: 403
just need to parse this string into a datetime object.
Answers are here: How to parse an ISO 8601-formatted date?
so you can use dateutil.parser
or iso8601
modules.
Upvotes: 3