import datetime
import pytz
string_date = "2017-04-2800:00:49.640+03:00"
my_date = datetime.datetime.now(pytz.timezone('Europe/Moscow'))
my_date1 = datetime.datetime.strptixme(string_date, "%Y-%m-%d%H:%M:%S.%f%z")
if my_date > my_date1:
print (my_date)
else:
print (my_date1)
from django.utils.dateparse import parse_datetime
string_date = "2017-04-28T00:00:49.640+03:00"
my_date1 = parse_datetime(string_date)