How to get the Day part from below String date?

string date = "24/12/2013";

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

Using DateTime format,we can get day part from any given string date.We have to pass format in ToString method of DateTime class as dd.

For Example:-

string date_part = Convert.ToDateTime(date).ToString("dd");


Output would be :- 24.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response