DateTime format release

Why does the slash change to a dash when providing an explicit date format (screen below)?

enter image description here

+4
source share
2 answers

Because the slash is a locale specific date separator. To insert a slash explicitly, you need to avoid it. See Documentation

+5
source

Try

.ToString("dd'/'MM'/'yyyy") 
0
source

Source: https://habr.com/ru/post/1346811/


All Articles