I am using Django 1.11 and Postgres 9.4.
How can I convert this
2018-01-01T00:00:00+03:00
into a datetime object that can be used for queryset like below
Tracking.objects.filter(created_at__gte=input_datetime)
for Z time I can use this:
input_datetime = datetime.datetime.strptime("2019-11-01T01:36:56.233032Z", "%Y-%m-%dT%H:%M:%SZ")
but how can I make it work for this time (which seems to have timezone). I tried this but it didnt work.
input_datetime = datetime.datetime.strptime('2018-01-01T00:00:00+03:00','%Y-%m-%dT%H:%M:%S.%f%z')
Here is my model.py
class Tracking(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)