You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/12/18 04:46:46 UTC
[GitHub] phoenix24 commented on a change in pull request #5961: Convert to
same time zone before minus
phoenix24 commented on a change in pull request #5961: Convert to same time zone before minus
URL: https://github.com/apache/incubator-superset/pull/5961#discussion_r242405528
##########
File path: superset/utils.py
##########
@@ -363,7 +363,7 @@ def pessimistic_json_iso_dttm_ser(obj):
def datetime_to_epoch(dttm):
if dttm.tzinfo:
epoch_with_tz = pytz.utc.localize(EPOCH)
- return (dttm - epoch_with_tz).total_seconds() * 1000
+ return (dttm.astimezone(pytz.UTC) - epoch_with_tz).total_seconds() * 1000
Review comment:
if it's not too much to ask, this could use a little test to assert the change / bug fix.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org