Created
April 16, 2015 07:19
-
-
Save itkr/d1dd925fdf071e99e1a3 to your computer and use it in GitHub Desktop.
timetuple
This file contains 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 | |
import time | |
a = datetime.now() | |
# datetime.datetime(2015, 4, 16, 16, 15, 47, 92560) | |
b = int(time.mktime(a.timetuple())) | |
# 1429168547 | |
datetime.fromtimestamp(b) | |
# datetime.datetime(2015, 4, 16, 16, 15, 47) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment