Add time elapsed next to last modified timestamp, or js variable (wgCurRevisionTimestamp)
Open, LowPublic


Author: bugspray7

Per the referenced Village Pump discussion, please add an approximate "time delta since last modification" field near the existing "last modified" timestamp field at the page footer.

Currently says:
This page was last modified on June 17, 2009 at 22:55.

Want something like:
This page was last modified on June 17, 2009 at 22:55 (about 3 hours ago).

Version: unspecified
Severity: enhancement
See Also:


bzimport set Reference to bz19276.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Jun 18 2009, 7:05 AM

Changed component from Wikimedia to MediaWiki. This is a software feature request.

herd wrote:

This would be broken into little pieces by cache, and rather useless I think.

Here is an experimental gadget. It is necessarly a big ugly horrible mash of functions to find what timezone offset the time given was actually in (one can NOT assume it is the same as the browser's):

What could be done, is to have <li id="lastmod"> contain a comment like:

<li id="lastmod"> This page was last modified on 18 June 2009 at 00:54. <!--1245316447--> </li>

This then could very easily be parsed as a Unix timestamp by javascript, making the above gadget about 1/10th the size, with no API calls. There would also be no cache issues.

Suggest repurpose the bug for exposing unix time (hidden?) into the <li>.

bugspray7 wrote:

Sounds good. The VPP discussion suggested JavaScript would likely need to be employed to avoid breaking caching.

herd wrote:

Okay, it looks like all skins have the "last modified" text. per Skin::lastModified

However, they are not in an object with consistent class or id. It can be <li id="lastmod">, <li id="foot-info-lastmod">, <p>, etc.

Suggest changing the bug to request the function to either:

  1. return $s wrapped in a <span id="lastmodmsg"> (excluding the "wfMsg('laggedslavemode')" <strong> msg) and insert the unix timestamp as a comment: <!--1245316447--> inside the span.
  1. just wrap the comment in a span with unique ID (a bit silly).
  1. just inserting the comment anywhere on the page (probably in the lastmod function, for convenience) but with identifying characteristics, such as a non-translated consistent string: <!--lastmod:1245316447-->.

Any of these would make it easy enough to report a much more accurate time since last edit in javascript, even with cache.

brion added a comment.Jun 23 2009, 1:44 AM

If it's going to be included at all, just stick it in the JS vars...

herd wrote:

If it's going to be included at all, just stick it in the JS vars...

Oh come on, where is the challenge in that ^_^.


Add Comment