summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-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()