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.

mdnajimahmed
  • 124
  • 2
  • 9

1 Answers1

2

Use the ParseExact method. Example:

string d = "20130611T150000Z";

DateTime t = DateTime.ParseExact(d, "yyyyMMdd'T'HHmmss'Z'", CultureInfo.InvariantCulture);
Guffa
  • 687,336
  • 108
  • 737
  • 1,005