Windows Notepad: Insert Time and Date into Text or Log File

   Posted June 6, 2005 by David Kirk in Windows

Notepad is one of Window’s best tools. As I frequently use it with logs, here are a couple of time and date tricks I have learned over the years.

Notepad is simple and full of little tricks. I use it for creating and using log files all the time. Here are a couple of ways to use Notepad to automatically insert the time and date. These techniques work for all versions of Microsoft Windows, including XP, Vista, and Windows 7.

Automatically insert a timestamp every time a file is opened:

A simple way to record what you are doing at certain times is with a .LOG file in Notepad. Using this method, each time you open and close Notepad, a timestamp is created to time your activities more efficiently. Simply open the document, record what you did, save the file, and then close it.

1. Open Notepad.
2. On the first line of the file, type this:

3. Hit ENTER to insert one carriage return.
4. Save the file.

By doing this, every time you open the file in Notepad, a timestamp will be inserted.

timestamps in log file

Insert Current Timestamp

If you are in any text document in Notepad and decide you need to add the current timestamp, just hit F5. The timestamp will automatically be created.


About David Kirk

David Kirk is one of the original founders of tech-recipes and is currently serving as editor-in-chief. Not only has he been crafting tutorials for over ten years, but in his other life he also enjoys taking care of critically ill patients as an ICU physician.
View more articles by David Kirk

The Conversation

Follow the reactions below and share your own thoughts.

  • Maggie

    How to enter a column with date in notepade

  • mike ritter

    love the .log hint

    note, i place a plus sign after my entry so the posts are seperated by a good separator.

  • 13chenj1

    how do you undo it…
    what if i dont want a timestamp everytime?

    • Guest

      Just delete the .LOG text from your text file, save it, and thats it! ^^

      • S_skerhut

        F5 key

        • Guest


          • Guest

            F5 key is cool

  • Richie

    Love F5…

  • Neerajawasthi4

    how it is heppening

  • SchepperMC

    .log is fine

  • John Dyslexic

    This is a fantastic use for note taking throughout the day.
    It enables me to write short notes of things that happen and keep an automatic time stamp. Very useful for a dyslexic as an extra short term memory tool!!

    Thanks a lot David!

  • Stefan

    Thanks David,

    Great tip. I can use .LOG to re-start writing a journal. F5, too.

    Do you know of a way to reverse the order of the entries so that the most current entry goes to the top? I’ve looked around but haven’t found a way. Maybe you have?

    Thanks again.

  • MainMeat

    Very Handy Tip!
    thank you