Skip to content

Instantly share code, notes, and snippets.

@akhan118
Created July 27, 2018 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akhan118/36c87b44ef33730c792658fb8cfe5df9 to your computer and use it in GitHub Desktop.
Save akhan118/36c87b44ef33730c792658fb8cfe5df9 to your computer and use it in GitHub Desktop.
Converting time stamps to milliseconds since epoch.
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