Reputation: 1373
I use this code for convert "yyyy-MM-ddTHH:mm:ssZ" to DateTime datatype in C#:
string PurchaseDate == "2017-12-12T14:29:26Z";
datetime dt = DateTime.ParseExact(PurchaseDate , "yyyy-MM-ddTHH:mm:ssZ", null);
i expect, dt fills with {12/12/2017 14:29:26 PM} but it fills with {12/12/2017 5:59:26 PM} ! why it change this time ?
Upvotes: 0
Views: 4007
Reputation: 320
The trailing Z refers to the Zulu time. Zulu time is equivalent to the UTC (see here for further reference)
The parsing you're doing converts the datetime into the "local" timezone.
Upvotes: 1