Skip to content

Instantly share code, notes, and snippets.

@akhan118
Created July 27, 2018 21:20
Show Gist options
  • Select an option

  • Save akhan118/36c87b44ef33730c792658fb8cfe5df9 to your computer and use it in GitHub Desktop.

Select an option

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