Date vs DateTime

后端 未结 12 1699
暖寄归人
暖寄归人 2020-11-30 05:13

I am working on a program that requires the date of an event to get returned.

I am looking for a Date, not a DateTime.

Is there

12条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 05:42

    DateTime has a Date property that you can use to isolate the date part. The ToString method also does a good job of only displaying the Date part when the time part is empty.

提交回复
热议问题