[Zodb-checkins] CVS: Zope3/lib/python/ZODB - TimeStamp.py:1.2

Jeremy Hylton jeremy@zope.com
Wed, 4 Dec 2002 16:37:04 -0500


Update of /cvs-repository/Zope3/lib/python/ZODB
In directory cvs.zope.org:/tmp/cvs-serv13786/lib/python/ZODB

Modified Files:
	TimeStamp.py 
Log Message:
Add a helper function to generate a TimeStamp from a time.time().




=== Zope3/lib/python/ZODB/TimeStamp.py 1.1 => 1.2 ===
--- Zope3/lib/python/ZODB/TimeStamp.py:1.1	Fri Nov 22 16:41:14 2002
+++ Zope3/lib/python/ZODB/TimeStamp.py	Wed Dec  4 16:37:02 2002
@@ -16,9 +16,11 @@
 from _TimeStamp import TimeStamp
 
 def newTimeStamp(prev=None):
-    t = time.time()
-    args = time.gmtime(t)[:5] + (t % 60,)
-    ts = TimeStamp(*args)
+    ts = timeStampFromTime(time.time())
     if prev is not None:
         ts = ts.laterThan(prev)
     return ts
+
+def timeStampFromTime(t):
+    args = time.gmtime(t)[:5] + (t % 60,)
+    return TimeStamp(*args)