summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-06-03 17:49:01 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-06-03 17:49:01 +0200
commit757eeb6675792b5d8c8c5d40ea3f3ce9231d641f (patch)
tree6d1b863d46f1080f95a92e19c767c04b55bfcd10
parentd430c2c08f2920d5830f723420bbeaac9bece1ac (diff)
quotes: Import the time module.
-rw-r--r--modules/quotes.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/quotes.py b/modules/quotes.py
index 772701c..cf2cdbe 100644
--- a/modules/quotes.py
+++ b/modules/quotes.py
@@ -4,7 +4,7 @@ info = {
'description': 'Allows users to access a quote database.',
}
-import random
+import random, time
from pyPgSQL import PgSQL
class Quotes:
@@ -27,7 +27,7 @@ class Quotes:
def add(self, nick, quote):
cur = self.db.cursor()
- cur.execute('insert into quotes (nick, date, quote) values (%s, extract(epoch FROM now()), %s)', (nick, quote))
+ cur.execute('insert into quotes (nick, date, quote) values (%s, %d, %s)', (nick, int(time.time()), quote))
cur.execute('select currval(\'quotes_id_seq\')')
lastrowid = cur.fetchone()[0]
cur.close()