Created
October 28, 2015 19:02
-
-
Save galileoguzman/461ddf7d54d6f7106265 to your computer and use it in GitHub Desktop.
How to convert unix timestamp to datetime python class
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
## IMPORT THE DATETIME MODULE | |
import datetime | |
## CONVERT THE RAW STRING WITH STRFTIME METHOD | |
print( | |
datetime.datetime.fromtimestamp( | |
int("1284101485") | |
).strftime('%Y-%m-%d %H:%M:%S') | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment