I need to execute an condition where after starting from 150 days from today using the system date format.
String test = DateTime.Now.ToString("dd.MM.yyy");
String test2 =DateTime.Now.AddDays(150).ToString("dd.MM.yyy");
if (test == test2)//Not sure how to do it in IF condition here for date tim
{
}
Any help on this would be great.
Pravesh Singh
06-Mar-2014var dateToUse = DateTime.Now; // can be any DateTime value, if you use DateTime.Now the condition is useless
var date1 = dateToUse.Date; // Get Date part
var date2 = DateTime.Today.AddDays(150);
if (date1 == date2)
; // Do something if dates are equal