在 C# DateTime 中,UTC 月份是否 'wrong' 相对于 LocalTime?

Is UTC month ever 'wrong' relative to LocalTime in C# DateTime?

这是一个有点 'silly' 的简单问题,但我无法在 google 上找到任何内容(或找到正确的搜索词)。我也不确定如何测试这个问题。

给定 DateTime current = DateTime.Utc; 是否存在 DateTime.UtcNow.Month != DateTime.Now.Month 的情况?

或者表达方式不同,我是否需要这样做 TimeZoneInfo.ConvertTimeFromUtc(o.CreatedAt.Value.UtcDateTime, TimeZoneInfo.Local).Month == i 或者我可以简单地做 o.CreatedAt.Value.UtcDateTime.Month == i 其中 i 是表示为整数的本地日期时间月份?

肯定会有这样的时刻,UTC 在一个月内,而您的本地时间在不同的时间。由于时间偏移,这可能发生在每月的 last/first 天。

比如。我在格林尼治标准时间 3,所以在 6 月 30 日 11:00pm 我会在 6 月,但在 UTC 中已经是 7 月 1 日了。