How to convert below date into
dd-MM-yyyy format?

string date = "24/12/2013";

 Posted by vishalneeraj-24503 on 12/24/2013 | Category: C# Interview questions | Views: 3412 | Points: 40

Using DateTime format,we can convert given date to any format.We have to pass format in ToString method of DateTime class as dd-MM-yyyy.

For Example:-

string dt = Convert.ToDateTime(date).ToString("dd-MM-yyyy");

Output would be :- 24-12-2013

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response