mirror of
https://github.com/zulip/zulip.git
synced 2025-10-28 10:33:54 +00:00
timestamp: Remove datetime_to_precise_timestamp for datetime.timestamp.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
6ec808b8df
commit
159641bab8
@@ -1,6 +1,5 @@
|
||||
import calendar
|
||||
import datetime
|
||||
import time
|
||||
|
||||
|
||||
class TimezoneNotUTCException(Exception):
|
||||
@@ -41,7 +40,3 @@ def timestamp_to_datetime(timestamp: float) -> datetime.datetime:
|
||||
def datetime_to_timestamp(dt: datetime.datetime) -> int:
|
||||
verify_UTC(dt)
|
||||
return calendar.timegm(dt.timetuple())
|
||||
|
||||
def datetime_to_precise_timestamp(dt: datetime.datetime) -> float:
|
||||
verify_UTC(dt)
|
||||
return time.mktime(dt.timetuple()) + dt.microsecond/1000000
|
||||
|
||||
Reference in New Issue
Block a user