Skip to content
Snippets Groups Projects
Commit 9a3e24a1 authored by Richard van der Hoff's avatar Richard van der Hoff Committed by Amber Brown
Browse files

drop undocumented dependency on dateutil (#4266)

It turns out we were relying on dateutil being pulled in transitively by
pysaml2. There's no need for that bloat.
parent e8d98466
No related branches found
No related tags found
No related merge requests found
drop undocumented dependency on dateutil
......@@ -14,12 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import datetime
import calendar
import logging
import time
from dateutil import tz
from synapse.api.constants import PresenceState
from synapse.storage.devices import DeviceStore
from synapse.storage.user_erasure_store import UserErasureStore
......@@ -357,10 +355,11 @@ class DataStore(RoomMemberStore, RoomStore,
"""
Returns millisecond unixtime for start of UTC day.
"""
now = datetime.datetime.utcnow()
today_start = datetime.datetime(now.year, now.month,
now.day, tzinfo=tz.tzutc())
return int(time.mktime(today_start.timetuple())) * 1000
now = time.gmtime()
today_start = calendar.timegm((
now.tm_year, now.tm_mon, now.tm_mday, 0, 0, 0,
))
return today_start * 1000
def generate_user_daily_visits(self):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment