Last active
May 14, 2017 15:06
-
-
Save conquistadorjd/cd532ae4ce914c724d2aa265c6815d2d to your computer and use it in GitHub Desktop.
datetime sample
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
import datetime | |
# get todays date | |
dt = datetime.datetime.today() | |
print dt | |
DATE='22-May-2017' | |
# get todays date | |
dt = datetime.datetime.today().strftime('%Y-%m-%d') | |
print dt |
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
import datetime second | |
# get todays date | |
dt = datetime.datetime.today() | |
print dt | |
DATE='22-May-2017' | |
# get todays date | |
dt = datetime.datetime.today().strftime('%Y-%m-%d') | |
print dt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment