title: Python pytz: convert local time to utc. Localize doesn't seem to convert
body: <p>I have a database that stores datetime as UTC. I need to look up info from a particular time, but the date and time are given in a local time, let's say 'Europe/Copenhagen'. I'm given these as:</p>
  
  <pre><code>year = 2012; month = 12; day = 2; hour = 13; min = 1;
  </code></pre>
  
  <p>So, I need to convert these to UTC so I can look them up in the database. I want to do this using <code>pytz</code>. I am looking at <code>localize</code>:</p>
  
  <pre><code> local_tz = timezone('Europe/Copenhagen')
   t = local_tz.localize(datetime.datetime(year, month, day, hour, min))
  </code></pre>
  
  <p>But I'm confused about <code>localize()</code>. Is this assuming that year, etc, are given to me in local time? Or, is it assuming that they they are given in UTC and now it has converted them to local time? </p>
  
  <p><code>print t</code> gives me:</p>
  
  <pre><code>2012-12-02 13:01:00+01:00
  </code></pre>
  
  <p>So it seems that it assumed that the original year, etc was in utc; hours is now 13+1 instead of 13. So what should I do instead? I have read the pytz documentation and this does not make it clearer to me. It mentions a lot that things are tricky so I'm not sure whether pytz is actually solving these issues. And, I don't always know if the examples are showing me things that work or things that won't work.</p>
  
  <p>I tried normalize:</p>
  
  <pre><code>print local_tz.normalize(t)
  </code></pre>
  
  <p>That gives me the same result as print t.</p>
  
  <p>EDIT: With the numbers given above for year etc. it should match up with information in the database for 2012-12-2 12:01. (since Copenhagen is utc+1 on that date)</p>