how to convert a string into datetime in c#
How to convert a string into datetime in c#
step-1:
First include this namespace
using System.Globalization;
Step-2:
Use the following code.
DateTime datetime = DateTime.ParseExact("01-may-1990", "dd-MMMM-yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None);
Comments
Post a Comment