The DateTime is formatted in ISO 8601 in UTC (with the "Z" suffix). Parsing it back in Roundtrip mode (DateTime.Parse("...", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind)
) will automatically handle it correctly:
Strings that are passed to the Parse, TryParse, ParseExact, and TryParseExact methods of DateTime and DateTimeOffset can be parsed by using the "O" or "o" format specifier if they are in one of these formats. In the case of DateTime objects, the parsing overload that you call should also include a styles parameter with a value of DateTimeStyles.RoundtripKind. Note that if you call a parsing method with the custom format string that corresponds to the "O" or "o" format specifier, you won't get the same results as "O" or "o". This is because parsing methods that use a custom format string can't parse the string representation of date and time values that lack a time zone component or use "Z" to indicate UTC. [my emphasis]
What's going wrong in the code: By specifying "Z" as a character in your format string, you are matching the character "Z" literally (uppercase "Z" is not a custom format specifier), which leads to throwing away the time zone information and depending on the DateTimeStyles parameter to interpret the time zone. It's possible to pick the right value for this, but the better option is to use the round-trip format mode which already knows how to take care of this.
Edit: annoyingly, DateTime.ParseExact( datestr, "o", CultureInfo.InvariantCulture )
(parsing with "o") doesn't work, but parsing with the DateTimeStyles.RoundtripKind parameter does. Thanks to @SirRufo for pointing this out.