<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: unixtimestamp</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/unixtimestamp.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2007-09-03T01:54:35+00:00</updated><author><name>Simon Willison</name></author><entry><title>calendar.timegm()</title><link href="https://simonwillison.net/2007/Sep/3/calendar/#atom-tag" rel="alternate"/><published>2007-09-03T01:54:35+00:00</published><updated>2007-09-03T01:54:35+00:00</updated><id>https://simonwillison.net/2007/Sep/3/calendar/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://docs.python.org/lib/module-calendar.html#l2h-719"&gt;calendar.timegm()&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
An “unrelated but handy function” that converts a time.gmtime() in to a corresponding Unix timestamp. I’ve been hand-rolling this one for years; never thought to look in calendar.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="http://intertwingly.net/blog/2007/09/02/Dealing-With-Dates"&gt;Sam Ruby&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/calendar"&gt;calendar&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/datetime"&gt;datetime&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sam-ruby"&gt;sam-ruby&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/time"&gt;time&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/timezones"&gt;timezones&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/unixtimestamp"&gt;unixtimestamp&lt;/a&gt;&lt;/p&gt;



</summary><category term="calendar"/><category term="datetime"/><category term="python"/><category term="sam-ruby"/><category term="time"/><category term="timezones"/><category term="unixtimestamp"/></entry></feed>