> For the complete documentation index, see [llms.txt](https://wiki.smhuda.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.smhuda.com/programming/python/filename-with-date-time-stamp.md).

# 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
```
