title: Converting an ambigious time to a correct local time with Python
body: <p>I'm wrestling with what appears to be a common timezone issue in Python, but have not been able to solve it or find the exact issue I'm running into here on SO, so I pose the question below.</p>
  
  <p>I have a timetuple that does not have a timezone set. I also have a timezone. And I have the computer in a different timezone. How do I convert the time to the local time taking DST into account?</p>
  
  <pre><code>&gt;&gt;&gt; type(dt.value)
  &lt;type 'datetime.datetime'&gt;
  &gt;&gt;&gt; print dt.timetuple()
  time.struct_time(tm_year=2012, tm_mon=6, tm_mday=28, ..., tm_isdst=-1)
  &gt;&gt;&gt; print somezone.zone
  America/New_York
  </code></pre>
  
  <p>If I add the zone info to <code>dt</code> as follows, DST isn't handled properly... <code>tm_isdst</code> always shows up as zero, regardless of the month being in DST or not.</p>
  
  <pre><code>dt.value = dt.value.replace(tzinfo=somezone)
  &gt;&gt;&gt; print dt.timetuple()
  time.struct_time(tm_year=2012, tm_mon=6, tm_mday=28, ..., tm_isdst=0)
  </code></pre>