try DateTime.Parse(string)


From: manoj kumar [mailto:[EMAIL PROTECTED]
Sent: Monday, November 01, 2004 5:00 AM
To: [EMAIL PROTECTED]
Subject: Re: [Microsofts_C_Sharp] How to assign String value to date.

Hi mohan,
try this

Convert.ToDateTime(DateTime.ParseExact(strPin[3],"dd/MM/yyyy", System.Globalization.CultureInfo.CurrentCulture).ToString("MM/dd/yyyy"));

first u need to change the current culuture in to MM/dd/yyyy. hope this will help u

Regards
Manoj



mohanraj <[EMAIL PROTECTED]> wrote:


HI :

 
  How to convert string to Date Value..

      here this is code
      System.DateTime dt = new System.DateTime ();
      dt = System.DateTime.ParseExact("02/06/2004");

  when i try to convert iam getting following Error.

   System.FormatException: String was not recognized as a valid DateTime.


Regards,

J. Mohanraj




Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

Yahoo! Groups Sponsor

Get unlimited calls to

U.S./Canada



Yahoo! Groups Links

Reply via email to