Re: How to get dateCreated for Rich Results

encyc via Wikitech-l <[email protected]>
Newsgroups gmane.science.linguistics.wikipedia.technical
Message-ID <Y3VCcDaUVnhDdiwmM61xmwUQHkde1zCB1GijwZSpkEsKnM34kFGHoa3QHY2UI7KW6kpwWhPtSCSZfU4Fr5GkukJiVImU7DsmDIz99nXCVF0=@protonmail.com>
Thank you Felipe. That worked.

encyc

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

On Thursday, December 11th, 2025 at 12:48 PM, Felipe Schenone <[email protected]> wrote:

> If you're developing an extension and you have a [Title object](https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Title_1_1Title.html), you can do:
>
> use MediaWiki\MediaWikiServices;
> $services = MediaWikiServices::getInstance();
> $revision = $services->getRevisionLookup()->getFirstRevision( $title );
> $timestamp = $revision->getTimestamp();
>
> Bear in mind that the timestamp will be in MediaWiki format, see [Manual:Timestamp](https://www.mediawiki.org/wiki/Manual:Timestamp).
>
> On Thu, Dec 11, 2025 at 2:20 PM rtnF <[email protected]> wrote:
>
>> Use rvdir=newer to get earliest revision.
>>
>> Example :
>>
>> [https://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=OpenStreetMap&rvlimit=1&rvdir=newer&rvprop=timestamp|user&format=json](https://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=OpenStreetMap&rvlimit=1&rvdir=newer&rvprop=timestamp%7Cuser&format=json)
>>
>> On Fri, Dec 12, 2025, 12:03 AM encyc via Wikitech-l <[email protected]> wrote:
>>
>>> Good afternoon everyone and thank you for this list.
>>>
>>> I'm working on an extension (https://www.mediawiki.org/wiki/Extension:RichResults) and need to know the best way to get the article creation date (https://schema.org/dateCreated), i.e. the first edit date. dateModified was easy but dateCreated seems different. I understand it might mean hitting the database. What's the best way to do this without slowing performance? (version 1.44+)https://schema.org/dateCreated
>>>
>>> Flounder ceo
>>> encyc
>>>
>>> Sent with [Proton Mail](https://proton.me/mail/home) secure email.
>>> _______________________________________________
>>> Wikitech-l mailing list -- [email protected]
>>> To unsubscribe send an email to [email protected]
>>> https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
>>
>> _______________________________________________
>> Wikitech-l mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
>> https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/

_______________________________________________
Wikitech-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.