how to convert string to date c# code example
Example 1: c# string to datetime
string iDate = "05/05/2005";
DateTime oDate = Convert.ToDateTime(iDate);
MessageBox.Show(oDate.Day + " " + oDate.Month + " " + oDate.Year );
Example 2: string to date vb
Dim iDate As String = "05/05/2005"
Dim oDate As DateTime = Convert.ToDateTime(iDate)
MsgBox(oDate.Day & " " & oDate.Month & " " & oDate.Year)
Example 3: string to datetime c#
DateTime.TryParse(stringDate, out DateTime date);
//date variable type is DateTime