title: Get POSIX/Unix time in seconds and nanoseconds in Python?
body: <p>I've been trying to find a way to get the time since 1970-01-01 00:00:00 UTC in seconds and nanoseconds in python and I cannot find anything that will give me the proper precision.</p>
  
  <p>I have tried using time module, but that precision is only to microseconds, so the code I tried was:</p>
  
  <pre><code>import time
  
  print time.time()
  </code></pre>
  
  <p>which gave me a result like this:</p>
  
  <pre><code>1267918039.01
  </code></pre>
  
  <p>However, I need a result that looks like this:</p>
  
  <pre><code>1267918039.331291406
  </code></pre>
  
  <p>Does anyone know a possible way to express UNIX time in seconds and nanoseconds?  I cannot find a way to set the proper precision or get a result in the correct format.  Thank you for any help</p>