converting string to valid datetime

Posted by Ranjana on Stack Overflow See other posts from Stack Overflow or by Ranjana
Published on 2010-06-15T10:19:54Z Indexed on 2010/06/15 10:22 UTC
Read the original article Hit count: 271

strdate=15/06/2010

DateTime dt = DateTime.Parse(strdate, System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat);

i cannot able to get the datetime value as dd/mm/yyyy. it is giving exception 'string is not recognized as a valid datetime'

oly if it is in 06/15/2010 it is working. how to get the same format in dt.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about string