Convert string to DateTime

by Raju Maharjan 19. June 2011 22:32

//String Datetime

string myDate="01-11-2011";

 

IFormatProvider theCultureInfo = new System.Globalization.CultureInfo("en-GB"true);

DateTime theDateTime = DateTime.ParseExact(myDate, "mm-dd-yyyy", theCultureInfo);

 

 

Tags: , ,

.NET Programming Tips | C#

Comments

Add comment


() (Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading




Sapnep IT Solution

We Provide IT solutions and services to deliver a unique blend of real-business experience with a strong engineering, international project delivery. We are a software development  firm.