Emil Elkjær Nielsen Emil Elkjær Nielsen - 5 months ago 31
iOS Question

Xamarin.IOS date format

I am currently working on a app which should be able to scan some codes, QR etc.

However when I am scanning a VEVENT code the date format is looking like this:


20140713T190000Z


My question is basicly how I can convert this into a normal DateTime which I can use to add events to the calender?

Thanks in advance

Answer

use DateTime.ParseExact

DateTime d = DateTime.ParseExact("20140713T190000Z","yyyyMMdd'T'HHmmss'Z'",null);

also see this question