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.
   i think, you might add them here `/tests/utils_tests.py`

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to