Summary: Display RecentChanges and History timestamps in the local timezone of each visitor.
Version: 20201220
Prerequisites: JavaScript
Status: Beta
Maintainer: Petko
Users: +4 (view / edit)
Discussion: LocalTimes-Talk
License: GPL3+


When many people from different countries use a wiki, it is annoying to see the date/time stamps in a single timezone, different from their own. For a reader in Europe or in New Zealand, having the dates in the Dallas/TX timezone makes it hard to estimate when an edit was actually made.

The recipe rewrites the timestamps in RecentChanges pages and on page histories to show the time in the local timezone of each reader. The original date/time string is moved to a tooltip/title and appears when the mouse cursor is positioned over the link.

If you reopen the RecentChanges page, any new changes since your previous visit on that page will be highlighted in a light-yellow background. Different RecentChanges pages retain their own last-visited-timestamps.

For the changes from the last 24 hours, after the page entry, a "+" plus sign is appended. Clicking on it will fetch and display the authors and summaries of the changes to that page from the last 48 hours.

The recipe is now enabled on pmwiki.org, see for example Site.AllRecentChangesShort.


Place the file localtimes.phpΔ into your pmwiki/cookbook directory.

Copy localtimes.js to your pmwiki/pub directory. Add near the end of local/config.php such code:


Note that the installation code changed in version 20150906.

Note that LocalTimes has built-in the functionality of the recipe "Better RecentChanges" from TrackChanges, but you cannot have the two recipes at the same time. If you previously used TrackChanges, please remove its installation code from config.php.


You can configure the duration of the fetched page history.

In config.php, set

  $LastTimesHours = 24; // 24 hours; default is 48

To disable the "+" plus button and the fetching of recent history, set this variable to 0:

  $LastTimesHours = 0;

To change the highlight color for new/unseen changes, add this to pub/css/local.css:

  .ltnew{ background-color: orange; }


In a RecentChanges page, or in a Page History, you will see the timestamps in the local time zone of your operating system.

Note that in RecentChanges, only pages modified after the installation of the recipe will have their timestamps localized.

Click on the "+" plus sign after a page entry to see its recent history.


The visitors' browsers need to have JavaScript enabled or they will see the date/time in the timezone of the server.

The recipe expects the RecentChanges format to be in standard bulleted or numbered lists. Other formats are not supported, eg. Tables may produce unexpected results and errors.

If the skin has a <div id="wikitext"> block, the recipe will only scan links in it and will work faster. If the page heading has the class "pagetitle", the recipe will append the current local time to the heading in light gray. (The default "pmwiki" and "pmwiki-responsive" skins and many other skins contain these elements.)

Change log / Release notes

  • 20201220 - middle-click on the highlighted entries (except on the links) will now clear the background.
  • 20191117 - add a CSS class "ltreload" to the 'time' reload text, used by PendingChanges.
  • 20190818 - the browser will now save the last timestamp into localStorage, and will highlight entries that were added or modified since that last timestamp.
  • 20160515 - click on the pagetitle timestamp will now reload the page.
  • 20150906 - fix "+" plus signs, no longer displayed if no more edits in 48 hours (takes effect up to 48 hours after upgrade). No more need to edit localtimes.js. Added styles for the "+" signs. Please note that the installation code changed.
  • 20150830a - silently ignore missing elements in skins, without generating JavaScript errors.
  • 20150830 - bug fix: escape special characters in the fetched page summaries.
  • 20150804 - add Ajax fetching of recent page history.
  • 20150621 - append time to pagetitle heading.
  • 20121231 - minor refactoring, changes from less than 24 hours show just the time.
  • 20121109 - changed today's changes to show just the time.
  • 20110607 - fix tooltip titles in Internet Explorer.
  • 20110605 - first public release, ready to be tested.

See also


  • Petko is author and maintainer of this recipe (5ko [snail] 5ko [period] fr).
  • If this recipe helps you or saves you time, you can help support its continued development by .


See discussion at LocalTimes-Talk

User notes +4: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.