Filename with Date/Time Stamp

Create a file name with the current date & time in Python:

import time
timestr = time.strftime("%Y%m%d-%H%M%S")
print timestr

Output:

20120515-155045

Last updated