Get UTC timestamp from time zone aware datetime object in Python
<p>I have a datetime object that I created with<code>datetime.datetime(year, month, day, hour, minute, tzinfo=pytz.timezone('US/Pacific'))</code>.
Please correct me if I'm wrong, but I believe that my datetime object is NOT naÃ¯ve. How do I convert this datetime object to a UTC timestamp?</p>

<pre><code>non_naive_datetime_obj.astimezone(pytz.utc).timestamp()
</code></pre>

python datetime utc