Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# convert string to datetime

string dateInput = "1/1/2022";
DateTime date;
if ( DateTime.TryParse(dateInput, out date) ) {
	Console.WriteLine("Success");
} else {
	Console.WriteLine("Fail");
}
Source by net-informations.com #
 
PREVIOUS NEXT
Tagged: #convert #string #datetime
ADD COMMENT
Topic
Name
1+9 =