diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index e736a857eac8bb31764897ecb4c828ebe43ae49c..417b9aa2a8b49fa0f4df241cd8d7da24ad475cdb 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -275,9 +275,9 @@ class DataStore(RoomMemberStore, RoomStore,
         """
         def _count_r30_users(txn):
             thirty_days_in_secs = 86400 * 30
-            now = int(self._clock.time_msec())
-            thirty_days_ago_in_secs = now/1000 - thirty_days_in_secs
-
+            now = int(self._clock.time())
+            thirty_days_ago_in_secs = now - thirty_days_in_secs
+            print str(thirty_days_ago_in_secs)
             sql = """
                 SELECT platform, COALESCE(count(*), 0) FROM (
                      SELECT