Created
May 1, 2019 18:31
-
-
Save gargolito/ce6c208fd032673bdd7aeb246eebd169 to your computer and use it in GitHub Desktop.
#python
This file contains hidden or 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
| # convert string time to epoch | |
| In [1]: from datetime import datetime | |
| In [2]: ts = '2017-01-16 19:35:49.105642' | |
| In [3]: datetime.strptime(ts, "%Y-%m-%d %H:%M:%S.%f").strftime("%s") | |
| Out[4]: '1484613349' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment