Published
- 1 min read
python generate file name with date
The solution for this is noted below
python generate file name with date
Solution
import time
timestr = time.strftime("%Y%m%d-%H%M%S")
print timestr
# yields:
# 20120515-155045
Try other methods by searching on the site. That is if this doesn’t work