date formats

I've been searching the forums and have found many comments, but am not sure which information is reliable and current or the best way to fix this.

In my shared group library, there are different items with m.d.y and others with d.m.y. Maybe that's due to the settings of different people who have added. In the list, dates are displayed as they were entered, but they still sort correctly. This is very confusing.

How can I have a consistent date format for all of my items? I don't really care what it is, as long as it displays consistently and I don't need to constantly correct dates for items that other people have added. As a side note, if I could choose, it would be DD.MM.YYYY
  • No, it's not currently possible to change what is displayed for dates. Such an option is planned. As you note, the dates are internally stored in YYYY-MM-DD format, which is used for sorting and formatting citations.
  • It's good to know that such an option is planned for future releases. I presume, once implemented, this would mean that if a person selects, say, DD.MM.YYYY, Zotero will modify all entries, no matter how they were originally formatted (e.g., 5 May, 2020; May 5, 2020, 2020, May 5, etc, etc)?
  • We're not planning to make the date format customizable — that should be controlled by the system, and Zotero should just pick that up. The plan is to show dates in a locale-defined format as long as they parse cleanly with no extra parts. So all the examples you give would display uniformly.
  • edited August 4, 2020
    I can understand that each detail view might show the date as it was entered even if it's stored as DD.MM.YYYY in the database.

    But is there really no way to view a list of my entire library and see them all in the same date format? Otherwise, when I click on sort and there are DD.MM and MM.DD dates mixed together, it appears that they're actually not sorted. This drives me crazy because I have to go through the entire list and look at the detail view to verify that the date is entered correctly or not. And on those detail views, it's not sufficient to just have all be in the same date format. I need to read carefully to learn which date format was assigned to each item and then verify that it's correct. For the project that I'm working on now, I can still remember what's 4.8 or 8.4, but in a year from now I might not remember anymore what was correct.

    It's also especially a concern for collaborative libraries. Someone with a system setting of MM.DD may read the library list and see that all dates appear to be in DD.MM. Then that person would create many additional entries all in DD.MM, even when their local system settings are in MM.DD. So this would then result in them entering the dates incorrectly. I've already caught this error several times from my colleagues.

    This kind of user behavior makes sense because nearly all online forms require the user to enter dates in a particular format, not according to their own system settings. Also excel has a single date format per column and it's displayed consistently.

    By when do you think this change will be implemented? From the forum posts, it seems like it's been discussed already for quite some time. I'd prefer an intuitive solution instead of needing to constantly remind our team to double-check their system date settings and to enter them in that way in Zotero.
  • That's interesting, dstillman. I would prefer the format to be YYYY-MM-DD in every situation, but the extra parts bit sounds like it might be a bit of a nuisance. I assume the "extra parts" would be references that have, for example, two years in the date field (e.g., 2018/2019) or ambiguous additional date information (e.g., a random number that isn't clearly a year, month, or day)? Do you know of any way to quickly and automatically identify references with these extra parts in Zotero?
  • For the project that I'm working on now, I can still remember what's 4.8 or 8.4, but in a year from now I might not remember anymore what was correct.
    @rohrkemper: For now, for a group with people from multiple locales, it's better to just enter the dates in an unambiguous format — e.g., with the month name written out, or as YYYY-MM-DD.
    I assume the "extra parts" would be references that have, for example, two years in the date field (e.g., 2018/2019) or ambiguous additional date information (e.g., a random number that isn't clearly a year, month, or day)?
    @sciwonder: Yes, though Zotero will support additional date formats in the future for things like date ranges and ambiguous dates (in the historical sense, not the syntactical sense), so the number of cases where there are extra parts will decrease.

    There's no way to identify items with extra date parts through the UI at the moment, but here's a script you can run in the Run JavaScript window:

    var items = await Zotero.Items.getAll(Zotero.Libraries.userLibraryID, true);
    var pairs = items.map(item => {
    var date = item.getField('date', false, true);
    if (!date) return false;
    var parsed = Zotero.Date.strToDate(date);
    if (!parsed.part) return false;
    return [item.key, item.getDisplayTitle(), date];
    })
    .filter(x => x);
    return pairs;


    (This is for your personal library. Doing it in a group library would require a little adjustment.)
  • Thanks dstillman! That worked well—identified three entries with extra parts in the date field that clearly didn't belong there, so it was easy enough to fix.
  • This might be a bit unrelated but I am looking for ways to toggle the display of dates in fields such as "Accessed". While I always enter dates as YYYY-MM-DD and while my OS (macOS) is set to YYYY-MM-DD, Zotero displays dates following the US custom of MM/DD/YYYY, which is highly confusing.
  • @till.grallert: It follows the system language/region, not any custom system date format. If the language is set to "English (US)" and/or the region is set to United States, it will use the US format. If you don't want to adjust your system settings, you can override Zotero's locale by changing the language in the Advanced pane of the Zotero preferences. (If you want it still in English but with non-US dates, choose "English (UK)".)
  • @dstillman Thank you very much for the quick reply. Changing the language in the Advanced pane of the Zotero preferences to "English (UK)" at least changes to DD/MM/YYYY. It would be great if one could get a plain old YYYY-MM-DD format with a future update.
    Best,
  • Hi @till.grallert, which Zotero version are you using? I cannot find where to change that in Advanced tab of Preferences on version 6.0.9-beta.4+256bd157e.
  • @psyguy: It's right at the top of the Advanced → General pane in the preferences.
  • Ah, I now see it, thanks @dstillman! Because it was set to Automatic (English) I thought it is not what till.grallert meant.

    I hope in a new update custom date formats (like YYYY-MM-DD) be included.
  • I would also like to have a consistent date format in the display (and export). Currently, when I export the metadata of an item to a markdown file (using zotero-mdnotes), the inconsistent format of the dates in the exported file makes it impossible to sort.
  • >I would also like to have a consistent date format in the display (and export). Currently, when I export the metadata of an item to a markdown file (using zotero-mdnotes), the inconsistent format of the dates in the exported file makes it impossible to sort.

    Same!
  • I'd like to have YYYY-MM-DD format as well, especially if for this case, Zotero already uses this format internally. Another place the less-ideally-formatted date pops up is when using the 'Add Note from Annotations' option after annotationing a PDF within Zotero, which produces a note with this title: "# Annotations (11/25/2022, 9:23:45 AM)". It would be great to have access to the format of the date (and 24-hour time, etc.) here for uniform searchability.
  • After writing the above, I decided to check out the other locales and realized that 'English (Canada)' uses the YYYY-MM-DD format by default. Still AM/PM 12-hour time, but this is still a good partial solution for me, eh?
  • Both plugins [Jasminum](https://github.com/l0o0/jasminum) and [zotero-format-metadata](https://github.com/northword/zotero-format-metadata#readme) provide the function to convert Date to ISO YYYY-MM-DD format, hope it is useful for you.
  • Thanks a lot for this conversation, it helps me to cure a library.
Sign In or Register to comment.