Optimizing alternatives to DateTime.Now

前端 未结 4 1189
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 04:36

A colleague and I are going back and forth on this issue and I\'m hoping to get some outside opinions as to whether or not my proposed solution is a good idea.

First

4条回答
  •  猫巷女王i
    2020-12-29 05:01

    Could you just use DateTime.UtcNow, and only convert to local time when the data is presented? You've already determined that DateTime.UtcNow is much faster and it will remove any ambiguity around DST.

提交回复
热议问题