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?
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?
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).
If you can provide a Debug ID for this occurring, we can take a look.
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.
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
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.
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.
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;
Mon Aug 06 2018 14:20:27 GMT-0300 (Hora oficial do Brasil)
06/08/2018
2018-08-06 17:20:27
new Date(2019, 7, 6, 17, 20, 27)
"2019-08-06T20:20:27.000Z"
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');
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)
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)
Tue Aug 06 2019 14:20:27 GMT-0300 (Hora oficial do Brasil)
I am having the same issue with my Zotero 5.0.73 (Windows 10). I noticed that all date information is correct except the year (2018 instead of 2019). The weirdest thing happens when I add a citation from Chrome, it initially presents the right year (2019), but a few seconds later, it becomes 2018. I took screenshots if it is of any help.
Do you have any idea when that fix will be available? I often sort my library for some projects using date added, and it makes things a little awkward.
Thank you all for your great support as always!
I realized also that upon this morning my database is not updating correctly in the standalone interface, it doesn't load the most recent entries (although everything is correctly updated online). I deleted the zotero.sqlite and resynced 2 or 3 times, and every time the database is repopulated upon a different date. I am not a pro, but I guess that both problems are related.
It's been a few months as well.
I did not run all the tests that he did, but it seems that we're both from Brazil and using the UTC -03:00 (Brasilia) timezone.
I was using Zotero 5.0.73.
I updated to Zotero 5.0.74, as suggested by dstillman, ran a few tests, and it seems that the bug is fixed.
If someone still notice this issue in the new version, let us know here.