Page MenuHomePhabricator

Citoid returns incorrect publication date
Closed, ResolvedPublic0 Estimated Story Points

Description

Steps to reproduce:

  1. Open a page for editing in VE.
  2. Generate and add a reference for https://www.soeren-hentzschel.at/firefox/firefox-47-kann-artikel-vorlesen/
  3. Look at the date.

Expected: 2016-03-08 (after all, the source says <time property="datePublished" datetime="2016-03-08T01:16:07+01:00">8. März 2016</time>
Actual: 2016-03-07

Details

Event Timeline

We're using this property:

<meta property="article:published_time" content="2016-03-08T01:16:07+02:00" />

Which, in UTC is

> var d = new Date('2016-03-08T01:16:07+02:00');
> d.toISOString()
'2016-03-07T23:16:07.000Z'

the previous day. I'm not sure there's a clean way to fix this as using the date it was published in UTC seems the most precise...

It's a bit of a funny edge case, because as you point out, there is other metadata on the page, which we don't currently read in at all, that seems to have it published an hour later. Whatever software they're using to publish this is being a bit inconsistent with their metadata ^-^. Different plug-ins for each type of metadata that handle datetime differently, I'm betting.

The difference between the data on the page and the metadata is probably caused by a similar issue that exists in Mediawiki version histories, too: When the entry was published, the time zone was +01:00 (as in the content), which is now fixed. But as we currently have daylight saving time (+02:00) the metadata uses a different timestamp.

Anyway, I don't think the date should be converted to UTC, as the local time is more relevant. E.g. think of an article published for April's fool day. The date in the publisher's time zone is relevant, not the UTC.

Change 309599 had a related patch set uploaded (by Mvolz):
Remove TZ offsets & add ordinal incators

https://gerrit.wikimedia.org/r/309599

Jdforrester-WMF renamed this task from Automatic citation tool adds wrong date to Citoid returns a date in UTC, not following the timezone.Sep 12 2016, 9:17 PM
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF set the point value for this task to 0.

Change 309599 merged by jenkins-bot:
Remove TZ offsets & add ordinal incators

https://gerrit.wikimedia.org/r/309599

Strainu subscribed.

This also happens for access date, see: https://ro.wikipedia.org/w/index.php?title=Justi%C8%9Bie_capturat%C4%83&diff=prev&oldid=17303163

Since this can only be reproduced for 2h every day, here is a request and the associated response:

curl -X 'GET' 'https://ro.wikipedia.org/api/rest_v1/data/citation/zotero/https%3A%2F%2Fromania.europalibera.org%2Fa%2Fm-a-sunat-lia-ma-duc-sa-vorbesc-ce-spun-magistratii-si-ministrii-despre-independenta-si-eficienta-justitiei-din-romania%2F33620747.html' -H 'accept: application/json; charset=utf-8;'

[
  {
    "key": "JMD59UNV",
    "version": 0,
    "itemType": "newspaperArticle",
    "creators": [
      {
        "firstName": "Simona",
        "lastName": "Cârlugea",
        "creatorType": "author"
      },
      {
        "firstName": "Oana",
        "lastName": "Despa",
        "creatorType": "author"
      },
      {
        "firstName": "Andreea",
        "lastName": "Ofițeru",
        "creatorType": "author"
      },
      {
        "firstName": "George",
        "lastName": "Costiță",
        "creatorType": "author"
      }
    ],
    "tags": [
      {
        "tag": "Societate",
        "type": 1
      }
    ],
    "title": "„M-a sunat Lia, mă duc să vorbesc!”. Ce spun magistrații și miniștrii despre independența și eficiența Justiției din România",
    "publicationTitle": "Europa Liberă România",
    "url": "https://romania.europalibera.org/a/m-a-sunat-lia-ma-duc-sa-vorbesc-ce-spun-magistratii-si-ministrii-despre-independenta-si-eficienta-justitiei-din-romania/33620747.html",
    "abstractNote": "„M-a sunat Lia, mă duc să vorbesc”, i-a spus cu voce soptită judecătoarea așezată de-a dreapta șefei Curții de Apel București, Liana Arsenie. Nu s-a gândit nicio secundă că, din zecile de microfoane așezate în fața lor, măcar unul va prinde dialogul.\nApelul doamnei Lia Savonea, președinta...",
    "date": "2025-12-12",
    "language": "ro",
    "libraryCatalog": "romania.europalibera.org",
    "accessDate": "2025-12-12",
    "section": "Societate"
  }
]

This is really a diffferent issue, this ticket was about publication date being interpreted relative to the server.

Access-date is expected to be UTC because we don't localise responses in the service. This would have to be done client side. I would put this in a separate ticket. Unfortunately your case is harder to solve because it can't be done server side (as far as I know.) I suppose we could serve the time *in* UTC and then expect templates to interpret it correctly... nothing clean that people would like, unfortunately.

Mvolz renamed this task from Citoid returns a date in UTC, not following the timezone to Citoid returns incorrect publication date.Jan 22 2026, 1:16 PM