Popular recipes tagged "timestamp"http://code.activestate.com/recipes/tags/timestamp/popular/2011-04-14T15:39:57-07:00ActiveState Code RecipesArchiving time series (Python) 2011-04-14T15:39:57-07:00Tyler Grosshueschhttp://code.activestate.com/recipes/users/4177659/http://code.activestate.com/recipes/577653-archiving-time-series/ <p style="color: grey"> Python recipe 577653 by <a href="/recipes/users/4177659/">Tyler Grosshuesch</a> (<a href="/recipes/tags/archive/">archive</a>, <a href="/recipes/tags/backup/">backup</a>, <a href="/recipes/tags/timestamp/">timestamp</a>). </p> <p>Copies files and directories periodically to a time-stamaped directory. Used to create a running record of digital files to document change over time.</p> Get a posix timestamp from a type 1 uuid (Python) 2008-08-13T18:56:29-07:00Kent Tenneyhttp://code.activestate.com/recipes/users/4166394/http://code.activestate.com/recipes/576420-get-a-posix-timestamp-from-a-type-1-uuid/ <p style="color: grey"> Python recipe 576420 by <a href="/recipes/users/4166394/">Kent Tenney</a> (<a href="/recipes/tags/datetime/">datetime</a>, <a href="/recipes/tags/time/">time</a>, <a href="/recipes/tags/timestamp/">timestamp</a>, <a href="/recipes/tags/uuid/">uuid</a>). </p> <p>The uuid timestamp is 60 bits, the number of 100 nanosecond increments since Oct. 15, 1582 This simple function returns a value which makes datetime.datetime.fromtimestamp() happy.</p> <p>It simply rewinds the code in the standard library's uuid1 function:</p> <pre class="prettyprint"><code>nanoseconds = int(time() * 1e9) # 0x01b21dd213814000 is the number of 100-ns intervals between the # UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00. timestamp = int(nanoseconds/100) + 0x01b21dd213814000 </code></pre>