How to use correct regional format (date & time) o

2019-07-17 15:37发布

问题:

In WP8.1 region settings, one can set a country/region and a regional format. In my case I have United States as the country/region and German (Germany) as the regional format because of Cortana.

However, the time picker as well as the date picker use 12hrs AM/PM format and the US date format mm-dd-yyyy.

I can't find any property which tells me the regional format that's visible in the settings dialog of WP8.1.

Is there any localization/globalization feature of Windows Phone Store apps, that I am missing? How can I get the exact time/date output that's printed in the region settings dialog in my own app, without letting the user select the date/time format itself again?

回答1:

You can take a look at the Windows.Globalization.DateTimeFormatting namespace on how to get specific formatting date masks.

Also, take a look at the Windows.Globalization(http://msdn.microsoft.com/en-us/library/windows/apps/windows.globalization.aspx) namespace