Date format and parsing for "Set Date As" menu item

Is there a way to control or adjust how the “Set Date As” menu item parses dates? For example, when I open a PDF and select a date in the file (“02/10/2020”, which in my case is 2 October 2020), right click, and select “Set Date As”, the Created date of this document is set to 10.02.20, i.e. 10 February 2020, which is the wrong interpretation of the date string. This also means that it is parsing the date string using a different format from how dates are displayed in my user interface.

Is there a way to fix this?

Strangely, in the same right-click context menu, if I select “Show This Date in Calendar” instead of “Set Date As”, Calendar correctly opens to 2 October 2020! So, this other menu option seems to handle dates differently.

I’m using DEVONthink 3.7.2 Pro edition, in case that makes a difference.

Welcome @grail

which is the wrong interpretation of the date string

Actually, it’s not wrong depending on your locale. Here in the US that’s exactly as expected.

PS: The current version of DEVONthink is 3.8. Please make sure to stay current wih our point releases!

The date handling is currently independent of the used system settings, e.g. a database or even a single document might contain dates in various formats. Which locale do you use?

You are right, I should have clarified that I meant “wrong compared to the format I’m usually working with, and what I expected”.

Oops, sorry about not being on 3.8. I’ve upgraded now!

@cgrunenberg , how would I check the locale?

Under System Preferences > Language & Region > General I have: Region: Germany, Preferred languages: English (UK) — Primary; English (these settings are correct for me, i.e. I am in Germany and work mostly in English). The example date strings show 18.11.21, which is what I would expect.

Is there somewhere in DEVONthink that I need to set a locale, too (or even, as you suggested, on a per-database or per-file basis)?

11.11.21 would be parsed as expected but not 02/10/2020 due to the different separator. However, this is not customizable currently.

Ah, that’s a shame. So is there nothing I can do right now to fix it, I presume?

I seem to remember having success with a script in DEVONthink 2, but can’t remember which one or exactly how it worked (e.g. whether it would read the date from the selection, or if I had to copy-paste it from the document into a dialogue box that would appear). Do the scripts from DEVONthink 2 also work in DEVONthink 3?

No worries and glad you’re up to date now! :slight_smile:

Do the scripts from DEVONthink 2 also work in DEVONthink 3?

Generally speaking, yes they should.

I have a question about interpreting dates. You said…

select a date in the file (“02/10/2020”, which in my case is 2 October 2020)

How do you know this with just any file?
I can see it if it’s a file you created or there’s known content pointing to things happening in October. But say I sent you a document and said I sold my house on 03.09.2021. Would you assume I sold the house in September?

If you were writing to me in German or French - yes, I would. If you were writing in American English, I’d assume that it was March. If I were a pedantic person, I’d tell you to specify the date in ISO format.

Even if you knew I was in the States?

I agree with @chrillek but would slowly get the point (as befits a UK senior citizen) as it dawned on me that you came from a different world. :grinning: <Sigh> It’s like this “9/11” business…which was of course “11/9”.

Stephen

That would depend on where I was, and where you were. I’m aware that the format is ambiguous (I was going to mention that in my original post but thought it might be too much detail).

However, where I am and where my documents come from, essentially all dates are in DD.MM.YYYY format and not MM.DD.YYYY, and the rest of the system works like that. I was surprised to see the date parsed as MM.DD.YYYY given that (as far as I know) all my preferences/settings are set to DD.MM.YYYY, and even the DEVONthink user interface is displaying dates like that (DD.MM.YY).

For example, this means that the string “02/10/2020” in the PDF gets parsed by DEVONthink and then is immediately displayed back to me in the “Created” column in the user interface as “10.02.20”. The inconsistency was what made me think it was a bug or misconfiguration on my side. If DEVONthink always displayed dates in the UI as MM.DD.YY then I wouldn’t have been so surprised (although it would still have been inconvenient). So, I was hoping there would be some way to say “assume dates are in the same format as the UI”, or “assume this specified date format”.

1 Like

It seems also to be about the separators, ie slash vs dot. I’d say that at least in Germany the dot seems to be prevalent. So maybe if DT sees a slash it assumes another lake for this document.

That’s indeed the case.

Good to know. Also that you got what I possibly meant although I have no idea how that “lake” made its way into the post. Autocorrection is a bitch sometimes.

Hahaha! I was wondering if that was some Teutonic slang I don’t understand :wink: