Last active
August 29, 2015 14:24
-
-
Save rajasimon/295d5e7137f8a14b9374 to your computer and use it in GitHub Desktop.
Python Date
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
from datetime import datetime | |
datetime.fromtimestamp(1435916104) #datetime.datetime(2015, 7, 6, 2, 20, 14) | |
datetime.now().strftime('%Y-%m-%d') #'2015-07-09' | |
# Convert datetime to timestamp | |
import time | |
time.mktime(date.timetuple()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment