Add last update time in minutes counter in site

I want to add a "counter" in my site of the last update time. This means that they see a counter of: "Last update: 12 minutes ago." So it displays the minute of the last update ago.

It doesnt have to be real update time, if I can reset the timer when I want its good. Thanks for helping me out!


Thành viên BQT
You could have a PHP file that saves the current uxix time in a text file.

file_put_contents("time.txt", time());
All you need to do is to visit the page and it will set "now" as the time.

Then in your other page:
echo floor((time()-file_get_contents("time.txt"))/60) . " minutes ago";
This reads the file and calculates the number of minutes ago since last visit of set_time.php