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);            

1 comment:

  1. How to convert a string into datetime in c#

    Will help developers, students to convert a string...

    Well, we are here to read our blog....

    Top 10 IOS App Development Companies in Florida, USA | IOS App Developers Florida 2022

    Waiting for your future posts...

    ReplyDelete