Created
July 18, 2018 08:12
-
-
Save h3nryza/729866532cd036f8b458d3b7db0a553d to your computer and use it in GitHub Desktop.
Python date time for filename use
This file contains hidden or 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
| #!/usr/bin/python | |
| # -*- coding: <utf-8> -*- | |
| from __future__ import print_function | |
| import datetime | |
| dDate = datetime.datetime.now().strftime("%m/%d/%Y %I:%M:%S %p") | |
| dDate2 = datetime.datetime.now().strftime("%m-%d-%Y_%I%M%S%p") | |
| location = "C:/temp/" | |
| filename = "test.test" | |
| filename = location + "_" + filename + "_" + dDate2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment