c# - 如何知道给定日期是 UTC 还是 C# 中的本地日期
问题描述
我在邮递员中传递 Date Like DateTimeOffSet 之类的日期,我只想找出日期是 utc 还是 Local,
{
"fromDate": "2019-11-06T09:55:51.695Z",
"toDate": "2019-11-06T09:55:51.695Z"
}
我试过的是,
var fromDateKind = fromDate.UtcDateTime.Kind;
var toDateKind = toDate.UtcDateTime.Kind;
我需要检查给定的 FromDate 和 ToDate 是 UTC,如何知道给定的 Date 是 UTC 还是 Local