Try the following:
<TextBlock Text="{Binding PropertyPath, StringFormat=d}" />
which is culture sensitive and requires .NET 3.5 SP1 or higher.
NOTE. It is case sensitive. "d" is a short date format specifier , and "D" is a long date format specifier .
There is a complete list of string formats on this MSDN blog post page.
However, there is one question with this - it always displays the date in US format, if you yourself do not set the culture to the correct value.
If you do not set this property, the binding mechanism uses the Language property of the binding target. In XAML, this defaults to "en-US" or inherits the value from the root element (or any element) of the page, if it is explicitly set.
Source
One way to do this in the code behind (assuming you have configured the thread culture to the correct value):
this.Language = XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.Name);
Another way is to set the converter culture in binding:
<TextBlock Text="{Binding PropertyPath, StringFormat=d, ConverterCulture=en-GB}" />
Although this does not allow you to localize the output.
ChrisF Feb 18 2018-11-18T00: 00Z
source share