Please see my comment to the question. If you really have some dates in your C# code, your can compare them using the '==' operator defined for the type
System.DateTime
. If you have two points in time with the same date, the time values, obviously, can still be different, so you make them the same (and then only date part will affect the comparison) by using the property
System.DateTime.Date
:
http://msdn.microsoft.com/en-us/library/system.datetime.date.aspx[
^].
And, finally, if it so happens that on input you have just the string representing date/time in some format, you can parse it to
DateTime
using one of the
System.DateTime
methods
Parse
,
ParseExact
,
TryParse
or
TryParseExact
you will find here:
http://msdn.microsoft.com/en-us/library/system.datetime.aspx[
^].
—SA