Created
July 27, 2018 21:20
-
-
Save akhan118/36c87b44ef33730c792658fb8cfe5df9 to your computer and use it in GitHub Desktop.
Converting time stamps to milliseconds since epoch.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def unix_time_millis(self,dt): | |
epoch = datetime.utcfromtimestamp(0) | |
return int((dt - epoch).total_seconds() * 1000.0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment