How to Automatically Generate Datetime in Text File When Opened

I have a text file with instructions (or any type of data) that I want to generate a datatime value every time the file is opened. The data is written in the bottom of the file.

Here are the instructions with screenshots so that it is clearer to what I am talking about.

Step  1:- Open a new notpad (.txt) file or edit an existing text file.

Step 2:- Type .LOG in the first line.

Step 3:- Save and close the file with any name, but extension must be .TXT.

Step 4:- Open file.

Step 5:- Add any data.

Step 6:- Save and close file

Step 7:- Open the file again and see the difference … do you see the difference?

Step 6:- Now you got a wonderful data been inserted in the bottom of the text file.  Cool, isn’t it?

Example of the text file:

DateTime in text File

DateTime in text File