How to set a time zone (or a Kind) of a DateTime value?
问题 I mean to store strict UTC time in a DateTime variable and output it in ISO 8601 format. To do the last I've used .ToString("yyyy-MM-ddTHH:mm:sszzz"), and it has uncovered that the time zone is UTC+01:00. I've tried to use .Kind = DateTimeKind.Utc, but it says the Kind property has no setter. How do I explicitly specify the time is in UTC? How is the Kind property set? 回答1: While the DateTime.Kind property does not have a setter, the static method DateTime.SpecifyKind creates a DateTime