I have a string value that is datetime: "20100825161500" and I want to convert it to a system datetime. I tried Convert.ToDateTime and DateTime.Parse and they do not work.
You can use DateTime.ParseExact to pass the format you need.
Here is an example:
var parsed = DateTime.ParseExact("20100825161500","yyyyMMddHHmmss", null);
Possible format values ββare listed in Standard Date and Time Format Strings and Custom Date and Time Format Strings
Try using something like this
Datetime D = DateTime.ParseExact( "20100825161500", "yyyymmdd...", null)
, "format"
Since this line does not have a format recognized by these two functions.
DateTime.Parse and Convert.ToDateTime require proper formatting of the string: http://msdn.microsoft.com/en-us/library/1k1skd40.aspx
http://msdn.microsoft.com/en-us/library/xhz1w05e.aspx
You will need to write your own parser for such a conversion.