title: pytz US/Eastern converting timestamps back and forth
body: <p>From <a href="https://www.timeanddate.com/time/zone/usa/new-york-state" rel="nofollow noreferrer">time and date website</a>:</p>
  
  <pre><code>Generalized Time Zone in New York
  ET  Eastern Time    UTC -5:00 / -4:00   Wed, 11:42:33
  
  Time Zone Currently Being Used in New York
  UTC -5  EST Eastern Standard Time   New York    Wed, 11:42:33
  
  Time Zone Not Currently Being Observed in New York
  UTC -4  EDT Eastern Daylight Time   10 Mar 2019
  </code></pre>
  
  <p>So basically New York time is EST or EDT depending on which period of the year we are currently on due to the DayLight timesaving.</p>
  
  <p><strong><em>When using US/Eastern in pytz, does it refer to ET, EST or EDT?. Does it take into consideration the EST/EDT time change?</em></strong></p>
  
  <p>I am using this code to get timestamps for the beginning and end of the day of a given date in Eastern Time:</p>
  
  <pre class="lang-py prettyprint-override"><code>    import datetime
      import pytz
  
      session = datetime.datetime.strptime('26/02/2019', '%d/%m/%Y')
      exchange_tz = pytz.timezone('US/Eastern')
      session_localized = exchange_tz.localize(session)
  
      _period1 = int((session_localized - datetime.datetime(1970, 1, 1, tzinfo=exchange_tz)).total_seconds())
      _period2 = int((session_localized - datetime.datetime(1970, 1, 1, tzinfo=exchange_tz)).total_seconds()) + 24*60*60
  
      &gt;&gt;&gt; _period1
      1551139200
      &gt;&gt;&gt; _period2
      1551225600
  </code></pre>
  
  <p>I am not 100% sure that those timestamps have been properly generated. Because when I try to convert them back to localized datetimes I get 1 hour of difference:</p>
  
  <pre><code>    _exchange_tz = pytz.timezone('US/Eastern')
      _exchange_ts = _exchange_tz.localize( datetime.datetime.fromtimestamp(1551139200) )
  
      &gt;&gt;&gt; str(_exchange_ts)
      '2019-02-26 01:00:00-05:00'
  </code></pre>
  
  <p>Which as far as I understand, it shall be <code>2019-02-26 00:00:00</code>. What am I doing wrong?</p>
  
  <p>I have also read in <a href="http://pytz.sourceforge.net/" rel="nofollow noreferrer">pytz documentation</a> that <code>normalize()</code> function shall be used when doing arithmetics covering, but I am not sure if this apply to this case or not.</p>