Created
January 30, 2016 23:44
-
-
Save danker/c6316413ead90f7ff5cd to your computer and use it in GitHub Desktop.
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, timedelta | |
now = datetime.now() | |
print("Now: {}".format(now)) | |
print("Today's date: {}".format(now.strftime('%m/%d/%Y'))) | |
#print("year: {}".format(now.year)) | |
#print("month: {}".format(now.month)) | |
#print("day: {}".format(now.day)) | |
#print("hour: {}".format(now.hour)) | |
#print("minute: {}".format(now.minute)) | |
#print("second: {}".format(now.second)) | |
print("Yesterday: {}".format(now - timedelta(days=1))) | |
print("Last Week: {}".format(now - timedelta(weeks=1))) | |
print("Last Month: {}".format(now - timedelta(weeks=4))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment