Wrong year at Date Added Field

All the items I added to my library today get the Date Added field set to 2018/08/05 with the correct time (today is, in my time zone, 2019/08/05).

It happened with different types of archives pdf, tif, doc and with items added by file or plugin, just when I add the date is set correct but after some time it changes the year to 2018. For the items that I saved using the plugin it also changes the date in the Accessed field.

My OS is Windows 10 1903 18362.267, and its Date and Hour settings are correct.

I installed Zotero again, so I am using 5.0.73 version + ZotFile.

What should I try to fix this issue?
  • The "Modified" time shown in the right-hand pane when you look at the attachment is the modification time of the file itself, not the Zotero attachment item.
  • In the right-handed panel, there are at least 3 date fields: Date (for the published date, it is the date that came with the item's metadata), Date Added (the date the item came to Zotero) and Modified (the date the archive was last handed in that computer).

    My problem is with Date Added that is registering a year delay, even with my OS with the right date and time.

    Date Added is also an option to sort columns in the collection pane, as the date is wrong the order in the collections is messed up, which is a problem for me because I have to process the documents I put in Zotero based on the order they came.

    I made another test today, and the same problem happened: after some time Zotero changed the date to 2018/08/06 08:34:57 (correct day, month, hour and wrong year).
  • Other than merging items, which keeps the oldest Date Added value, nothing in Zotero should cause the Date Added to change. We've never had any other reports of this.

    If you can provide a Debug ID for this occurring, we can take a look.
  • edited 13 days ago
    If you're running any plugins (ZotFile or others), you should try with those disabled.
  • I disabled Zotfile, but the problem still occurs.
    I am sending a Debug ID D1906696443, I saved an item with firefox connector, it was a pdf with no matches, so it is just the file but the wrong date also happened.
  • That's very weird. Have you tried restarting your computer?
  • I could try, but it happened yesterday, I turned off the computer for the night and it also happened today.
  • I restarted the computer and also verified the BIOS date and hour, everything correct, but the problem still happening.

    I uninstalled Zotero, also cleaned %AppData%, reinstalled the Beta version (which I had at the beginning) installed the beta connector to firefox, saved a today online journal news and the problem still is happening

    Here is the reference Zotero made in the APA style:

    Quase 25% da população mundial enfrenta estresse hídrico extremo. (2019, August 6). Retrieved August 6, 2018, from GaúchaZH website: https://gauchazh.clicrbs.com.br/mundo/noticia/2019/08/quase-25-da-populacao-mundial-enfrenta-estresse-hidrico-extremo-cjyzvpray01q401nx7nmqq30e.html





  • Can you provide a Debug ID from Zotero that shows saving a regular item (not a PDF) and letting auto-sync kick in, such that the Accessed date also gets updated?
  • Sure, I saved 3 items from Scopus, here is the debug ID D1941148416.

    I also tried, based on this post https://deciphertools.com/blog/2016-04-14-windows-date-time-bugs/ to change the time zone. And I noticed that when I am in other time zones the problem doesn't happen. But when I came back to my original time zone (UTC-03:00) Brasília it starts again.
  • Those don't have Accessed dates. Just save the page you linked to above, which included one.
  • Also, as a simple test, if you just paste "2019-08-06 14:20:56" into the Accessed field of an item, is it saved as 2019 or 2018?
  • edited 13 days ago
    If I paste or change the accessed date to 2019/08/06 after some time it also changes to 2018/08/06.

    Here is the debug ID for this behaviour D711606850.

    I also tried to change an accessed date to 2019/01/01 it changed to 31/12/2018. But when I used a 2017 date it works. Seems like the dates got stuck until 2018.
  • Could it be a problem related to the time zone mappings from Java Runtime Environment?
  • edited 12 days ago
    No, nothing to do with Java.

    OK, this might take a little back and forth, but can you go to Tools → Developer → Run JavaScript, paste the code below into the left pane, and press Run, and then copy the result here?

    var str = '';
    var d = Zotero.Date.isoToDate('2019-08-06T17:20:27Z');
    str += d.toString() + '\n' + d.toLocaleDateString();
    var val = Zotero.Date.dateToSQL(d, true);
    str += '\n' + val;
    str;
  • Here is the result:

    Mon Aug 06 2018 14:20:27 GMT-0300 (Hora oficial do Brasil)
    06/08/2018
    2018-08-06 17:20:27
  • I think the problem is related to the Windows version, both my work and personal computer have the Windows 10 1903 version, and both have this date problem with Zotero, but a coworker who uses Zotero in both a Windows 7 and Windows 10 version 1803, although in the same time zone doesn't have the problem.
  • OK, another test in that window:

    new Date(2019, 7, 6, 17, 20, 27)
  • Result:
    "2019-08-06T20:20:27.000Z"
  • OK, how about this?

    var isoDate = '2019-08-06T17:20:27Z';
    var output = [];
    var _re8601 = /^([0-9]{4})(-([0-9]{2})(-([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?$/;
    var d = isoDate.match(_re8601);
    var offset = 0;
    var date = new Date(d[1], 0, 1);
    output.push(date.toString());
    if (d[3]) { date.setMonth(d[3] - 1); }
    output.push(date.toString());
    if (d[5]) { date.setDate(d[5]); }
    output.push(date.toString());
    if (d[7]) { date.setHours(d[7]); }
    output.push(date.toString());
    if (d[8]) { date.setMinutes(d[8]); }
    output.push(date.toString());
    if (d[10]) { date.setSeconds(d[10]); }
    output.push(date.toString());
    if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
    output.push(date.toString());
    if (d[14]) {
    offset = (Number(d[16]) * 60) + Number(d[17]);
    offset *= ((d[15] == '-') ? 1 : -1);
    }
    offset -= date.getTimezoneOffset();
    output.push(offset);
    output.push(Number(date));
    var time = (Number(date) + (offset * 60 * 1000));
    output.push(time);
    output.push(new Date(time).toString());
    output.join('\n');
  • Result:
    Mon Dec 31 2018 23:00:00 GMT-0300 (Hora oficial do Brasil)
    Fri Aug 31 2018 23:00:00 GMT-0300 (Hora oficial do Brasil)
    Mon Aug 06 2018 23:00:00 GMT-0300 (Hora oficial do Brasil)
    Mon Aug 06 2018 17:00:00 GMT-0300 (Hora oficial do Brasil)
    Mon Aug 06 2018 17:20:00 GMT-0300 (Hora oficial do Brasil)
    Mon Aug 06 2018 17:20:27 GMT-0300 (Hora oficial do Brasil)
    Mon Aug 06 2018 17:20:27 GMT-0300 (Hora oficial do Brasil)
    -180
    1533586827000
    1533576027000
    Mon Aug 06 2018 14:20:27 GMT-0300 (Hora oficial do Brasil)
  • And this?

    var isoDate = '2019-08-06T17:20:27Z';
    new Date("2019", 0, 1).toString() + "\n" + new Date(2019, 0, 1).toString() + "\n" + new Date(isoDate).toString();
  • Mon Dec 31 2018 23:00:00 GMT-0300 (Hora oficial do Brasil)
    Mon Dec 31 2018 23:00:00 GMT-0300 (Hora oficial do Brasil)
    Tue Aug 06 2019 14:20:27 GMT-0300 (Hora oficial do Brasil)
  • OK, this should be fixed in the latest Zotero beta, and the fix will be included in Zotero 5.0.74. Thanks for your help.
  • Just to let you know: I noticed the same problem today (the "Date added" exactly one year behind). A new version of Windows 10 (1903, I think) was installed in my computer two days ago.
Sign In or Register to comment.