How can I compare a date in C# to "1/1/0001 12:00:00 AM")

c#

Solution

You can use `DateTime.MinValue`, which has exactly the same value:

if (e.CreatedDate == DateTime.MinValue) 

Problem

I am trying the following: ``` if (e.CreatedDate == "1/1/0001 12:00:00 AM") ``` But this gives me an error saying I cannot compare a date to a string. How can I make it so I check the CreatedDate is equal to the "1/1/0001 12:00:00 AM" which is I guess the default?

Original source