comparing dates in c# taking null value into account
Posted
by Saif
on Stack Overflow
See other posts from Stack Overflow
or by Saif
Published on 2010-06-16T11:58:51Z
Indexed on
2010/06/16
12:12 UTC
Read the original article
Hit count: 164
c#
Hi
I am new to c#. I am comparing two dates where one is entered by user and the other one is sytem date time. i have the code working as it stands where the obstacle has occured is how to cater for null values. the basic code I have is:
if (mydate.ToShortDateString() != TodaysDate.ToShortDateString())
{
//Error Messaage
}
else
{
//do some code
}
Any feedback will be appreciated
© Stack Overflow or respective owner