i am trying to convert this string i get from the customer to a datetime, to store it in my db.
i tried several approches but nothing seems to work. i need the offset in UTC time so i guess i need to do something with zz.
This is working:
string test = "2008-06-11T16:11:20.0904778Z";
DateTime publishingTimeStamp = DateTime.ParseExact(test, "o", CultureInfo.InvariantCulture,
DateTimeStyles.None);
But the string by the customer is slightly different, so i tried this one:
string test = "2017-01-01T12:00:33:123456Z+02";
DateTime publishingTimeStamp = DateTime.ParseExact(test, "yyyy-MM-dd'T'HH:mm:ss:ffffffzz", System.Globalization.CultureInfo.InvariantCulture, DateTimeStyles.None);
Unfortunaly it is not working. How can i convert the exact string "2016-01-01T10:00:55:123456Z+02"? Is it even possible because it uses ":" in front of ffffff
Thank you