stamp = datetime.datetime.now().strftime("%Y_%M_%d_%H%M%S")
>>> from time import strftime >>> stamp = datetime.datetime.now().strftime("%Y_%M_%d_%H%M%S") >>> stamp '2013_56_30_155604' >>> >>> dt = strftime("%m_%d_%Y %H:%M:%S") >>> dt '05_30_2013 15:56:17' >>> >>> dt = strftime("%m_%d_%Y") >>> dt '05_30_2013'
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.