This method is used to convert the value of the current DateTime object to its equivalent short date string representation.
Syntax: public string ToShortDateString ();
Return Value: This method returns a string that contains the short date string representation of the current DateTime object.
Below programs illustrate the use of DateTime.ToShortDateString() Method:
date is 01/01/2010
date of 01/03/2010 04:00:15 is 01/03/2010 date of 01/05/2010 04:00:15 is 01/05/2010 date of 01/05/2010 04:00:15 is 01/05/2010
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.