Reputation: 44332
Should the following always match:
if(mydbrecord.DateField.Date == DateTime.Now.Date)
{...}
where mydbrecord date is the current day? I'm retrieving mydbrecord through linq-sql.
mydbrecord.DateField.Date is in the format '2013-12-19 00:00:00.000'.
Upvotes: 0
Views: 40
Reputation: 2992
Do it like this
if(mydbrecord.DateField.Date.ToString("yyyy/MM/dd") == DateTime.Now.Date.ToString("yyyy/MM/dd"))
{...}
Upvotes: 1