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

   Posted 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:
.LOG

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.

13 Responses to “Windows Notepad: Insert Time and Date into Text or Log File”

  1. March 03, 2009 at 12:04 am, Maggie said:

    How to enter a column with date in notepade

    Reply

  2. March 19, 2010 at 11:28 am, mike ritter said:

    love the .log hint

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

    Reply

  3. July 10, 2010 at 11:13 am, 13chenj1 said:

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

    Reply

    • August 06, 2010 at 11:14 pm, Guest said:

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

      Reply

      • September 03, 2010 at 8:05 pm, S_skerhut said:

        F5 key

        Reply

        • November 01, 2010 at 8:53 am, Guest said:

          F5

          Reply

          • November 01, 2010 at 8:54 am, Guest said:

            F5 key is cool

  4. December 08, 2010 at 7:42 pm, Richie said:

    Love F5…

    Reply

  5. April 20, 2011 at 7:52 am, Neerajawasthi4 said:

    how it is heppening

    Reply

  6. January 13, 2012 at 9:46 am, SchepperMC said:

    .log is fine

    Reply

  7. July 04, 2012 at 9:42 am, John Dyslexic said:

    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!

    Reply

  8. September 10, 2012 at 2:00 am, Stefan said:

    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.
    Stefan

    Reply

  9. May 20, 2013 at 5:03 am, MainMeat said:

    Very Handy Tip!
    thank you

    Reply

Leave a Reply