Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

timestamp: Switch to a slightly faster datetime_to_timestamp.

Alex Vandiver97a5690f5588
diff --git a/zerver/lib/timestamp.py b/zerver/lib/timestamp.py
index f636d9a5533..9098fcf6f9e 100644
--- a/zerver/lib/timestamp.py
+++ b/zerver/lib/timestamp.py
@@ -1,4 +1,3 @@
-import calendar
import datetime
@@ -47,4 +46,4 @@ def timestamp_to_datetime(timestamp: float) -> datetime.datetime:
def datetime_to_timestamp(dt: datetime.datetime) -> int:
verify_UTC(dt)
- return calendar.timegm(dt.timetuple())
+ return int(dt.timestamp())