0

I have a string which looks like 20130611T150000Z which is nothing but 2013 - 06 - 11- 15:00:00 in UTC time. How can I convert this to DateTime using c#? I am getting this value from kendoScheduler.

ivplay
  • 105
  • 2
  • 8

1 Answers1

2

Use the ParseExact method. Example:

string d = "20130611T150000Z";

DateTime t = DateTime.ParseExact(d, "yyyyMMdd'T'HHmmss'Z'", CultureInfo.InvariantCulture);
Guffa
  • 666,277
  • 106
  • 705
  • 986