Mediawiki/FIRSTREVISION

From Bjoern Hassler's website
Jump to: navigation, search

How do you get the creation date of an article (on mediawiki)? This doesn't seem to be possible through built-in variables, or e.g. through the semantic web extension.

Here's one way to do it: Using an internal api query we define new variables: {{FIRSTREVISIONTS}}, {{FIRSTREVISIONDATE}}, {{FIRSTREVISIONTIME}}:

TIMESTAMP: Template:FIRSTREVISIONTS

DATE: Template:FIRSTREVISIONDATE

TIME: Template:FIRSTREVISIONTIME

In most circumstances these will give the creation date of the article. But at least it gives you the nominal creation date: The first revision recorded for that article. (The first revision of an article can change if do a Special:Import that has earlier revisions. So strictly speaking the above doesn't always give you the creation date, but just the date of the first revision. But in most circumstances, that's ok.)