C# DateTime: What “date” to use when I'm using just the “time”?

后端 未结 12 1620
陌清茗
陌清茗 2020-12-16 09:35

I\'m using a DateTime in C# to display times. What date portion does everyone use when constructing a time?

E.g. the following is not valid because ther

12条回答
  •  死守一世寂寞
    2020-12-16 10:20

    A TimeSpan most certainly can store the time of the day - you just have to treat the value as the amount of time elapsed since midnight, basically the same way we read a clock.

提交回复
热议问题