You can declare mydate as DateTime?, then it can contain null values.
As for handling this error, it depends on whether the null value for mydate is considered an error or not. If this is a mistake, you can do:
if (mydate == null || mydate.ToShortDateString() != TodaysDate.ToShortDateString()) {
}
, :
if (mydate != null && mydate.ToShortDateString() != TodaysDate.ToShortDateString()) {
}
mydate DateTime?, DateTime, DateTime.MinValue, (DateTime.MinValue DateTime)
if (mydate == DateTime.MinValue || mydate.ToShortDateString() != TodaysDate.ToShortDateString()) {
// error
}