Answers for "how to convert string in date and time in c#"

C#
22

c# string to datetime

string iDate = "05/05/2005";
DateTime oDate = Convert.ToDateTime(iDate);
MessageBox.Show(oDate.Day + " " + oDate.Month + "  " + oDate.Year );
Posted by: Guest on March-08-2020
0

convert string to date in c#

DateTime convertedDate = DateTime.Parse(Date.ToString("yyyy-MM-dd"));
Posted by: Guest on September-29-2021
4

string to datetime c#

DateTime.TryParse(stringDate, out DateTime date);
//date variable type is DateTime
Posted by: Guest on January-12-2021

Code answers related to "how to convert string in date and time in c#"

C# Answers by Framework

Browse Popular Code Answers by Language