Looking for a better way to compare a nullable date time than the following:
Any suggestions?
// myobject.ExpireDatetime is of DateTime? // if (!myob
I would recommend you to use the following:
int y = Nullable.Compare(DateTime.UtcNow, x); // x is the nullable date time object. // y will be '-1' if x is greater than DateTime.UtcNow