Thursday 22 December 2011

How to convert Date format from dd/MM/yyyy to mm/dd/yyyy in asp.net





DEAR FRIENDS::

  SOME TIMES IN C# CODING DEVELOPER WANTS TO CONVERT DATETIME FORMAT AS MM/DD/YYY,  BUT SYSTEMS GIVES AN ERROR WHEN YOU INSERT 11/13/2011
IT GIVES AN ERROR
 because  datetime object default format is dd/mm/yyyy
and to convert datetime dd/mm/yyyy to mm/dd/yyyy format we have to write one  more line before converting datetime.

System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");

DateTime dtstart = Convert.ToDateTime(txtStart.Text);


I hope this helps you.

If You find right answer then please send me comment.



go through this link for wcf introduction
http://msdn.microsoft.com/en-us/library/aa480190.aspx

No comments:

Post a Comment

Contact Us:

Email:

Vinodkumar434@gmail.com,
vinodtechnosoft@gmail.com

Skype Name:

vinodtechnosoft