Properties: Date format not following system settings

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