python converting any datetime string to UTC
<p>I have a tedious function that does something like this:</p>

<pre><code>...
if ('PDT' in stringVal) or ('PST' in stringVal):
    utcdateTime = convert(stringVal)+(hardcode the offset)
elif('EDT' in stringVal)...
...
</code></pre>

<p>I looked at several posts including <a href="http://www.saltycrane.com/blog/2008/11/python-datetime-time-conversions/" rel="nofollow">this</a> but couldn't find anything that fits my purpose. I also looked at <code>datetime.datetime</code> and the whole <code>datetime</code> module in general but it has things like <code>.now()</code>; <code>.utcnow()</code>; <code>datetime.now(tz.pytz.utc)</code> etc etc. Basically if I have something like:</p>

<pre><code>2014-05-01 01:02:03 PDT
2014-05-01 01:02:03 PST
2014-05-01 01:02:03 EDT
2014-05-01 01:02:03 EST
2014-05-01 01:02:03 MDT
2014-05-01 01:02:03 MST
</code></pre>

<p>Is there a python module that has some method I can use to convert those above datetime strings to UTC? If there is none, I will just stick with the hard-coded way I have.</p>