mirror of https://github.com/apache/superset.git
Ensure that dttm is of same timezone as epoch_with_tz (#6453)
This commit is contained in:
parent
71a713dcec
commit
4579b12732
|
@ -358,6 +358,7 @@ def pessimistic_json_iso_dttm_ser(obj):
|
|||
|
||||
def datetime_to_epoch(dttm):
|
||||
if dttm.tzinfo:
|
||||
dttm = dttm.replace(tzinfo=pytz.utc)
|
||||
epoch_with_tz = pytz.utc.localize(EPOCH)
|
||||
return (dttm - epoch_with_tz).total_seconds() * 1000
|
||||
return (dttm - EPOCH).total_seconds() * 1000
|
||||
|
|
Loading…
Reference in New Issue