title: How to Convert GMT time to Local time
body: <p>I'm new to python and I need to convert the <code>air_time</code> variable to local machine time or the <code>current_time</code> variable to GMT and then subtract one from other in this script but don't know how to do it.</p>
  <pre><code>from datetime import datetime
  
  air_time_GMT = '2020-08-05 13:30:00'
  air_time = datetime.strptime(air_time_GMT, '%Y-%m-%d %H:%M:%S')
  current_time = datetime.now()
  
  time_remaining = air_time - current_time
  
  print(time_remaining)
  </code></pre>