Have Timestamps Automatically Added to Text Files Every Time You Edit Them


**Disclosure: This post contains affiliate links. If you make a purchase through these links, we may earn a small commission at no extra cost to you.

The Windows Notepad app is one of the more commonly used Windows applications and has been around since the first version of Windows itself. Many people use it for things such as taking simple notes, text editing, code and script writing, log files and creating things such as batch files.

If you are using Notepad on a regular basis to do something such as track events or log some type of changes then you may be interested in adding a timestamp to your work every time you add something to your Notepad file. That way, you will have a record of when you made a change to your file or added new information. In this article, we will be showing you how to have timestamps automatically added to text files every time you edit them.

For our example, we will be working on a Notepad file that is meant to keep track of expenses. The key to having timestamps automatically added to your text file is to add a certain entry at the very beginning of your text file. What you will need to do is add .LOG at the beginning of the file (in all caps and with a period at the beginning).

Notepad .LOG

The key to having timestamps added to your text file is that you will need to save your changes, otherwise it will not add a timestamp the next time you open the file.

We will now add the word Expenses to the top of our file and then save and close the file. The next time we open the file, it will add the current date and time on the next line.

Have Timestamps Automatically Added to Text Files Every Time You Edit Them

We can then add our expenses above the timestamp or even next to or below it. After adding the text, we will save and close the file.

Have Timestamps Automatically Added to Text Files Every Time You Edit Them

Now when we open the file again, the current date and time will be added below the last entry once again.

Have Timestamps Automatically Added to Text Files Every Time You Edit Them

Now if we were to just close the file and re-open it, it would not add a new timestamp since we didn’t save anything. Or if we were to add new data but not save the changes, Notepad would not add a timestamp once again.

As you can see, just by adding .LOG to the top of your Notepad file, you can have Notepad automatically add timestamps to your text files every time you edit them.

For additional training resources, check out our online IT training courses.

Check out our extensive IT book series.

Related Posts

© 2025 Online Computer Tips
Website by Anvil Zephyr