title: datetime to Unix timestamp with millisecond precision
body: <p>I'm trying to do something really simple, convert a <code>datetime</code> object three days into the future into a Unix UTC timestamp:</p>
  
  <pre><code>import datetime, time
  then = datetime.datetime.now() + datetime.timedelta(days=3)
  # Method 1
  print then.strftime("%s")
  # Method 2
  print time.mktime(then.timetuple())
  # Method 3 
  print time.mktime(then.timetuple()) * 1000
  </code></pre>
  
  <p>Method 1 and 2 give me Unix time in <em>seconds</em>, not milliseconds, and method 3 gives me milliseconds with no actual millisecond precision. </p>
  
  <p>When I simply print <code>then</code>, I get <code>datetime.datetime(2011, 11, 19, 15, 16, 8, 278271)</code>, so I know that the precision is available for milliseconds. How can I get a Unix timestamp with actual millisecond precision? If it's returned as a float and I have to flatten it to an an <code>int</code>, that's fine. Is there a solution I'm looking for that does this? </p>