That is because you are checking with
(DateTime.Now).ToString()
, which will be different always as it is a
DateTime
value, not
Date
only.
To get
Date
only, you have to store the
Date
only and compare that.
You can use
DateTime.Now.ToString("M/d/yyyy");
.
But make sure, while storing, you also store
Date
in this format.
To know more on formats, see -
Custom Date and Time Format Strings[
^].