Set an empty DateTime variable

前端 未结 12 2103
走了就别回头了
走了就别回头了 2020-12-16 08:59

I would declare an empty String variable like this:

    string myString = string.Empty;

Is there an equivalent for a \'DateTime\' variable

12条回答
  •  北荒
    北荒 (楼主)
    2020-12-16 09:23

    Option 1: Use a nullable DateTime?

    Option 2: Use DateTime.MinValue

    Personally, I'd prefer option 1.

提交回复
热议问题