import datetime date = datetime.datetime.now() # Access your date attributes print date.day print date.month print date.year >>> # Print a formatted date string >>> print date.strftime("%m/%d") >>> '05/10' # Test if between 6am and 8pm if 6 < date.hour < 20: print "It is election time"
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.