You must make sure both datetime have timezone info, or timezone info of None.
import datetimefrom dateutil import parser as dateutil_parsertoday = datetime.datetime.now()print(today.tzinfo) # None: no timezone infodate_str = '2019-08-10T00:00:00Z'd = dateutil_parser.parse(date_str)print(d.tzinfo) # tzutc(): this has utc timezone infod = d.replace(tzinfo=None) # remove timezone infodelta = today - d