here's a way how you could do it with some explanations in the comments:
from datetime import datetime, timezone
air_time_GMT = '2020-08-05 13:30:00'
# Python will assume your input is local time if you don't specify a time zone:
air_time = datetime.strptime(air_time_GMT, '%Y-%m-%d %H:%M:%S')
# ...so let's do this:
air_time = air_time.replace(tzinfo=timezone.utc) # using UTC since it's GMT
# again, if you don't supply a time zone, you will get a datetime object that
# refers to local time but has no time zone information:
current_time = datetime.now()
# if you want to compare this to a datetime object that HAS time zone information,
# you need to set it here as well. You can set local time zone via
current_time = current_time.astimezone()
print(current_time)
print(air_time-current_time)
>>> 2020-08-05 14:11:45.209587+02:00 # note that my machine is on UTC+2 / CEST
>>> 1:18:14.790413
You should notice two things here I think.
- For one, Python by default assumes a datetime object belongs to local time (OS time zone setting) if it is naive (no time zone information).
- Second, you cannot compare naive datetime objects (no time zone / UTC offset defined) to aware datetime objects (time zone information given).
[datetime module docs]