How to convert date format to DD-MM-YYYY in C#? I am only looking for DD-MM-YYYY format not anything else.
string formatted = date.ToString("dd-MM-yyyy");
will do it.
Here is a good reference for different formats.
2.1m questions
2.1m answers
60 comments
57.0k users