Properties: Date format not following system settings on Windows 10

Has anyone figured this out yet? I’m on a MacOS, whatever updated version… I’m so confused? Is there a place to switch the way the property settings appear bc it seems like I’ve got everything right? I’ve attached screenshots here… one is the source code, one the reader view, and one with the template settings… what am I doing wrong? I also checked the Journal date formats, and the template date formats… all of them have been switched to YYYY-MM-DD, but it’s still giving me the MM/DD/YYYY format when in reader view.



1 Like
  1. Quit Obsidian
  2.  > System Settings > General > Language & Region > Date format > CHANGE it to the format you want to see in Obsidian
  3. Restart Obsidian

Does that work okay? (Reading view is only cosmetic; the underlying data is what really matters.)

1 Like

Well, that’s really wild… so I did as instructed. Selected the YYYY-MM-DD in the Apple settings as you suggested above. So, that definitely has something to do with it… but now, instead of 09/12/2024 in reader view (Obsidian), it shows me Sep 12, 2024.

I went back to Apple settings again to see if I spaced the date format somehow. Nope, but then noticed at the bottom of that selection pane, it shows the way the date will be displayed in “Short” (2024-09-12), “Medium” (Sep 12, 2024), Long (September 12, 2024) and “Full” (Thursday, September 12, 2024)… how weird is that? So apparently Obsidian displays the Medium version of the selected date format.

So, apparently has something to do with which of those Mac date displays that Obsidian pulls in when in reader mode? Interesting.

This helped for sure, at least I see the connection. Will play around with that. I wonder if I switch the region to a place where DD-MM-YYYY is standard…

This was definitely helpful. And thanks for clarity on the reader mode really being more cosmetic, so to speak. Appreciate the help. Thank you!

same problem: no solution yet

1 Like

I found a workaround for Windows.

Background

Since it is more convenient to use English as the display language to search for info, and I also need to sort filenames containing Chinese in pinyin order, my language settings are as shown in the figure below.
Under these settings, “Date” and “Date & time” type fields in Obsidian properties are not displayed according to my windows data format settings, but are displayed in en-US format, also shown in the figure below.

But according to the official documentation, it should follow the Windows system setting, weird.

Finally, after some experiments, I found that the official documentation was inaccurate. The fact is that the settings made by the user on the “Change data formats” page can only take effect in Obsidian when the “Region format” and “Windows display” are consistent.

Workaround

Write a batch file to modify the relevant registry keys before starting Obsidian to “trick” Obsidian, and then restore these registry keys after Obsidian is started.

This method does work, the batch file is as follow. Remember to modify OBSIDIAN_EXE_PATH, 00000409 and en-US according to the actual situation of your own PC.

@echo off
setlocal enabledelayedexpansion

set OBSIDIAN_EXE_PATH="C:\Path\to\Obsidian.exe"
set REG_KEY="HKEY_CURRENT_USER\Control Panel\International"
set n=3
set value_names[0]="sShortDate"
set value_names[1]="sShortTime"
set value_names[2]="Locale"
set value_names[3]="LocaleName"
set new_data[0]="yyyy-MM-dd"
set new_data[1]="HH:mm"
:: Locale and LocaleName must be consistent with your Windows display language!!!
set new_data[2]="00000409" 
set new_data[3]="en-US"

:: Backup original registry settings
for /L %%i in (0,1,%n%-1) do (
    for /f "tokens=2*" %%A in ('reg query %REG_KEY% /v !value_names[%%i]!') do set orig_data[%%i]=%%B
)
:: Modify registry settings
for /L %%i in (0,1,%n%-1) do (
    reg add %REG_KEY% /v !value_names[%%i]! /t REG_SZ /d !new_data[%%i]! /f
)
:: Launch Obsidian and wait for it to finish loading your vault.
:: The timeout might depend on your device, on my PC 10s is long enough.
start "" %OBSIDIAN_EXE_PATH%
timeout /t 10
:: Restore original registry settings
for /L %%i in (0,1,%n%-1) do (
    reg add %REG_KEY% /v !value_names[%%i]! /t REG_SZ /d !orig_data[%%i]! /f
)

endlocal
2 Likes

I have the same problem, documented here

Me too! In my case I installed obsidian on my new work computer (running Windows 11), which came installed in Swedish. However, I soon found that when I needed help with any given program the best answers were in English, so I changed the system language to English (UK), so that menu buttons would match the available help. This, changed the way it shows dates and time in all programs, so I went back and changed the system to region to Sweden, and the regional format to Swedish. This behaves as it should in most programs, and the date on the task bar is in YYYY-MM-DD format, as it should be.

Sadly, Obsidian now shows the date field in properties as DD-MM-YYYY, which is really unacceptable for me.

I have checked settings, and all the places I can find date format under setting, such Daily Notes and Templates, it says that it is in YYYY-MM-DD format, which is what I want. Indeed, if I push the “open daily note” button next to the date field in properties, the new note it creates has the correct YYYY-MM-DD format.

I don’t understand why I can’t get the date format to show correctly under properties, and this is frustrating, as that is the only place I am entering dates, and my fingers know that it is always year first, and type it so on autopilot. I am absolutely going to enter dates incorrectly if it wants them in the wrong order.

How can I solve this?

Steps to reproduce

1- Open template note
2- Add property to template
3- define property type as date & time

Expected result

Date & type will display date field according to either app settings, or system settings.

Actual result

Date & type displays date field as mm/dd/yyyy --:-- -- based on the language.

Environment

SYSTEM INFO:
Obsidian version: v1.8.10
Installer version: v1.6.7
Operating system: Windows 10 Home 10.0.19045
Login status: logged in
Language: en
Catalyst license: none
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

I would still consider this a bug, or at least a much-needed feature.

Blaming the fact that Chrome (or Electron) doesn’t honour the Windows region format isn’t productive.

A workaround mentioned elsewhere: start Obsidian with the --lang flag, for example on Windows: obsidian.exe --lang=sv formats date according to ISO standard. This seem to be an Electron feature.

3 Likes

yes, there is that switch of electron and we may actively exploiting it in the future.

However, that doesn’t take from the fact that electron doesn’t autodetect the language region correctly on windows 10.

1 Like

Just wanted to add up here, as I have the exact same issue. Being outside of UK/US I just went ahead with the first English Qwerty layout I saw – which turned out to be US one and messed up the date format in the properties.
Switching to the UK locale as advised in the thread earlier helped, but we should really have the customization option in the settings for this.

Good to here that this works on Windows. On Linux (KDE, Wayland, .deb) this switch doesn’t do anything.