webplatform / mediawiki-conversion

Convert MediaWiki XML backup into structured raw text file tree
https://github.com/webplatform/docs
15 stars 4 forks source link

Ensure that calculated commit date aren’t miscalculated according to how MediaWiki handles them #7

Closed renoirb closed 9 years ago

renoirb commented 9 years ago

Provided the following Assumption is true, this is not an issue.

We already handle it using POPO (Plain Old PHP Objects).

$revisionXmlString = '<revision><!-- ... MediaWiki dumpBackup XML ... --></revision>';
$revisionNode = new SimpleXMLElement($revisionXmlString);
$timestamp = $this->setTimestamp(new \DateTime($revisionNode->timestamp, new \DateTimeZone('Z')));

Assumption

Provided that MediaWiki has a $wgLocaltimezone value set, the date shown in maintenance/dumpBackup.php XML output should be GMT-0 (Zulu, UTC)

Reference

renoirb commented 9 years ago

Confirmed. Works as-is.