I am getting a date and time from a data feed which I cannot change, and I need to convert it to a DateTime.
The format of the string is as follows.
timestamp="20131204T171054+0000"
You could use DateTime.ParseExact and specify a Custom Date and Time Format String.
Your sample looks like "yyyyMMddTHHmmssK" might work.
In vb.net
Dim timestamp As String = "20131204T171054+0000"
Dim dt As DateTime = DateTime.ParseExact(timestamp, "yyyyMMddTHHmmssK", CultureInfo.InvariantCulture)
In C#
string timestamp = "20131204T171054+0000";
DateTime dt = DateTime.ParseExact(timestamp, "yyyyMMddTHHmmssK", CultureInfo.InvariantCulture);
use the DateTime.Parse Function. You must pass a string value as its argument. Then, you can assign a DateTime to its result. This transforms the string into a value indicating the DateTime. below is the example of converting the sample string to datatime. I don't have any idea about the string you given in the question..
Dim value As String = "2000-02-02"
Dim time As DateTime = DateTime.Parse(value)