title: Python Code to convert Wed, 06 Feb 2019 20:47:46 GMT to 2019-02-06 15:47:46 EST or EDT
body: <p>I am trying to convert GMT time to EST/EDT format in Python.</p>
  
  <p>GMT Format: Wed, 06 Feb 2019 20:47:46 GMT<br>
  Required Format: 2019-02-06 15:47:46 EST (when daylight time starts it should be EDT)</p>
  
  <p>I need this without doing any additional pip install.
  Currently, I am using below code which is giving EST time as : 2019-02-06 15:47:46-05:00</p>
  
  <pre><code>import datetime
  from datetime import datetime
  from dateutil import tz
  
  enable_date = response["ResponseMetadata"]["HTTPHeaders"]["date"]
  print "Enable Date in GMT: {0}".format(enable_date)
  from_zone = tz.gettz('UTC')
  to_zone = tz.gettz('US/Eastern')
  utc = datetime.strptime(enable_date, '%a, %d %b %Y %H:%M:%S GMT')
  utc = utc.replace(tzinfo=from_zone)
  central = utc.astimezone(to_zone)
  print "Enable Date in EST: {0}".format(central)
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>Enable Date in GMT: Wed, 06 Feb 2019 20:47:46 GMT
  Enable Date in EST: 2019-02-06 15:47:46-05:00
  </code></pre>
  
  <p>desired output: </p>
  
  <pre><code>Enable Date in EST: 2019-02-06 15:47:46 EST
  </code></pre>
  
  <p>Variable enable_date has value Wed, 06 Feb 2019 20:47:46 GMT</p>