Properties: let the user customize the way Dates/Times are displayed (independently from OS)

I’m using multiple computers with different regional settings, and with the properties view this is really confusing. Even with non-slash regions slashes are used, but the order of DD/MM are reversed. I want to see the date as I’ve set up in my templates, not some random format. I can of course set the field to text as a workaround.

I’d appreciate getting the customizability back.

6 Likes

According to How to get the Date format in electron - javascript - Stack Overflow Electron uses the system locale to set the date/time format - which is correct for anyone who doesn’t have a different LANG and LC_TIME set. I use en_US for language and en_DK for date/time on Linux, and Obsidian is displaying en_US date format.

The implication of the Stack Overflow discussion is that Electron won’t (and can’t) display the preferred date/time format if it’s not the same as the locale setting, without some work. Though one could hack the locale setting on Linux to “solve” that.

Looking forward to being able to manually set the display in the app itself, I do so on other apps (Thunderbird for example), so that;s a good solution to my mind.

4 Likes

+1, I work on multiple devices and I can’t change all of the OS settings to adapt, my cellphone dosen’t even give me that option

1 Like

This seems to be a popular topic, pease refrain from +1s.

The thread will get unruly and people will get unnecessary notifications.

See Obsidian Forum - FAQ - Keep It Tidy

5 Likes

A possible workaround on Linux is to change the current locales in the obsidian.desktop file.

  1. Locate the .desktop file
    (normally in /usr/share/applications/)

  2. Change the Exec line with the locale you want (here an example): Exec=env LANG=fr_FR.utf8 LC_ALL=fr_CH.utf8 LANGUAGE=fr_FR /opt/Obsidian/obsidian %U

You can see your current locales by writing locale in a terminal and locale -a to see all locales available.

1 Like

This is (generally) broken on Linux.

I have a similar setup to @am4c130d with LANG=en_GB.UTF-8 and LC_TIME=de_DE.UTF-8, yet the dates are showing up as 19/09/2023 instead of German style, which should be 19.09.2023 according to my settings.

Testing @iomys solution with en_DK for ISO dates (https://askubuntu.com/questions/1226698/how-do-i-change-my-systemwide-date-and-time-format-to-iso-8601-yyyy-mm-dd-hhmm) was unsuccessful, even if the date command on the terminal does return the correct format.
Here’s my obsidian.desktop in case it matters:

[Desktop Entry]
Name=Obsidian
Comment=Markdown Notetaking App
GenericName=Text Editor
Type=Application
Exec=env LANG=en_DK.utf8 LC_ALL=en_DK.utf8 LANGUAGE=en_DK /home/argen/bin/obsidian %U
Icon=obsidian
StartupWMClass=obsidian
Categories=Work
MimeType=x-scheme-handler/obsidian;application/x-obsidian;

Here’s the output of locale:

LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=

And en_DK is in my locale list in the output of locale -a


As an additional comment not covered in my previous reply: This is philosophically very different from the per-vault settings that we have for everything else, e.g. see the contrast to this other open FR: Global Settings / Same settings, themes, and plugins across multiple vaults.

1 Like

There is parallel precedent of sorts. Obsidian’s core Daily Note plugin accepts any date formatting supported by moments.js, as does the core plugin Templates, and the core plugin Unique Note Creator. In fact, all three of those core plugins can have different date formats.

(One might wonder why “date” formatting is handed internally within Obsidian settings for the most part, except for the one case where date formatting is tied to the OS. Noting in the UI tells us to look in OS settings.)

1 Like

Yeah, I made this mistake recently… didn’t corrupt worksheet data, but did mess with reporting. Have since gone back to previous OS date format.

I appear to have found a resolution for my Chromebook.

I was searching Google’s support forums and found a similar reference. The end result was that I had to run

sudo dpkg-reconfigure locales

then remove en_US and then restart the chromebook

I am now able to see dates “correctly” (in the format used in Australia)

Another +1 for this, changing system settings just for one app is very weird. But regardless of that I’m on Linux so it’s more of a hassle and I haven’t been able to get it working in the first place as others have mentioned.

I did want to call out one extra part that I don’t see people discussing:

When you make this change please also add an option to switch between 24hr and 12hr time modes independant of the date format.

I am in the US so the date format works fine for me but I much much prefer 24hr times and the new datetime picker has no way to change that.

4 Likes

This is definitely broken on Win 10. Obsidian does not respect the OS short-date setting.
I like Obsidian, but to expect me to change the OS language setting is a bridge to far…

Could a possible workaround be to format the date using the ‘locale’ and ‘options’ parameters in Date.toLocaleString([locale], [options]). Then you could read those values from settings?

Also +1 that the setting needs to take time into account.

In the console I got the following results when trying different options:

navigator.language
‘en-US’

navigator.languages
(2) [‘en-US’, ‘sv-SE’]

new Date()
Tue Sep 26 2023 14:05:19 GMT+0200 (Central European Summer Time)

new Date().toLocaleString()
‘9/26/2023, 2:05:53 PM’

new Date().toLocaleString(‘sv-se’)
‘2023-09-26 14:07:45’

new Date().toISOString()
‘2023-09-26T12:09:17.555Z’

new Date().toDateString()
‘Tue Sep 26 2023’

new Date().toLocaleString(‘en-us’, {year: “numeric”, month: “short”, weekday: “short”})
‘Sep 2023 Tue’

1 Like

+1s have always been welcome. And people have been adding useful comments.

Users can unsubscribe from notifications from single topics. If you are overwhelmed with notifications, you should do so.

1 Like

I think they specifically mean comments that only say “+1” (or equivalent) with no additional content, which are discouraged by the FAQ they linked to (and are annoying if you want to follow the conversation but inevitable because the Like button isn’t an obvious enough way to upvote).

1 Like

I have the problem that the dates are shown in my preferred format (DD.MM.YYYY), but the input has to be YYYY-MM-DD.
So, I have written all dates as DD.MM.YYYY in the properties, but since the last update it shows the wrong dates, when I set the properties to visible.

Example:
When I write the date “29.09.2023” into the date section in the properties, the output is “20.09.2029”.
If I input it as “2023-09-29”, the date is parsed correctly and shown as “29.09.2023”.

Does anybody know, whether it’s possible to change the input format for the properties?

Obsidian 1.4.14
Windows 11 Pro 22H2
Short date format on OS: DD.MM.YYYY

When I write dates in the frontmatter I (almost) always go for YYYY-MM-DD. As it is now, Obsidian Properties View will render dates as MM-DD-YYYY, which is neither of my two “accepted” formats.

My take:

  • Obsidian should not assume my preferred formatting. What I want in Obsidian is not necessarily the same as what I want from other applications, or my OS in general.
  • Using USA based units or formats as the default is a bad idea (sorry), especially if you want to attract/keep international users.

Side note:
Why are document properties still rendered in reading mode when I’ve both disabled the Properties View plugin and set Editor > Properties in document to Source?
Even after restarting Obsidian.

2 Likes

The Properties view plugin is only for the Sidebar tabs (Show all properties & Show file properties). For hiding the Properties view in Reading mode, you could use the CSS snippet here.

1 Like

Ah, right.
Thank you for clearing that up :+1:
And thank you for the snippets!

Same here. My system setting is in 24 hr and it’ll be nice to display time in 24 hr in Obsidian as well.

It’s not Obsidian. Try this on Windows 10:

I found that page by opening the console; the definition looks like

input[type='datetime-local']

My system’s time/date settings were set to Swiss German defaults, DD.MM.YYYY, Obsidian still showed it as MM/DD/YYYY, which is a pain to read for me.

My Windows Language was set to “English (United States)”. I changed it to “Deutsch (Schweiz)” and everything is fine.

Since you won’t be able to fix Windows, I would suggest to let people define their own format. Hey, it’s Obsidian, right? :wink:

2 Likes

I can also verify that it is broken

Win 10.
I use English as system language and Sweden as region. My preferred date format is yyyy-mm-dd

date properties at set as mm/dd/yyyy

need it to work as daily notes, give me a property to define my date format…