title: Why is PST (America/Los_Angeles) time conversion to UTC, 1 hour behind?
body: <p>I have sensor data with a timestamp known to be in PST (Pacific Standard Time). Let's say that the timestamp is: <code>2020-10-21 10:00:00</code>. I want to convert that timestamp to UTC. UTC-to-PST conversion is UTC-8. So the <em>expected</em> timestamp in UTC is 8 hours forward: <code>2020-10-21 18:00:00</code>.</p>
  <p>I tried to do the conversion:</p>
  <pre><code>&gt;&gt;&gt; import pytz
  &gt;&gt;&gt; from datetime import datetime
  &gt;&gt;&gt; ts = datetime(2020,10,21,10,0,0)
  &gt;&gt;&gt; ts_local = pytz.timezone('America/Los_Angeles').localize(ts, is_dst=False)
  &gt;&gt;&gt; ts_local.strftime('%Y-%m-%d %H:%M:%S %Z%z')
  '2020-10-21 10:00:00 PDT-0700'
  &gt;&gt;&gt; ts_local.astimezone(pytz.utc).strftime('%Y-%m-%d %H:%M:%S %Z%z')
  '2020-10-21 17:00:00 UTC+0000'
  </code></pre>
  <p>But you can see that the conversion is 1 hour behind what is expected. This  seems to make sense since <code>ts_local</code> appears to be in <code>PDT</code>. However, because I'd set <code>is_dst=False</code>, I expected <code>ts_local</code> to be in <code>PST</code>.</p>
  <ul>
  <li>I've tried <code>is_dst=True</code> and <code>is_dst=None</code> (even though those flag values don't make sense since the timestamp is in Standard Time) but the resulting <code>ts_local</code> remains in <code>PDT</code>.</li>
  <li>I've tried this conversion in Python 3.7.4 and Python 2.7.17 and gotten the same result.</li>
  <li>I've also tried this conversion using the <code>'US/Pacific'</code> pytz timezone but same issue.</li>
  </ul>
  <p>I've read some other SO answers for how to do the conversion and what I've done is what has been suggested.</p>