Code

Added 'Users may only edit their issues' customisation example.
[roundup.git] / roundup / date.py
index b07bcf1664a41a34550da3f28f26b9e568c5cb38..49151768aedaf563b78e76c689702609803b671d 100644 (file)
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: date.py,v 1.58 2003-12-04 23:06:53 richard Exp $
+# $Id: date.py,v 1.59 2003-12-05 03:28:38 richard Exp $
 
 __doc__ = """
 Date, time and time interval handling.
@@ -323,6 +323,11 @@ class Date:
         return '%4d%02d%02d%02d%02d%02d'%(self.year, self.month,
             self.day, self.hour, self.minute, self.second)
 
+    def timestamp(self):
+        ''' return a UNIX timestamp for this date '''
+        return calendar.timegm((self.year, self.month, self.day, self.hour,
+            self.minute, self.second, 0, 0, 0))
+
 class Interval:
     '''
     Date intervals are specified using the suffixes "y", "m", and "d". The