DateTime compare; if(!DateTime.TryParse(FromDate.SelectedDateValue, out compare)) //fail to parse data var result =DateTime.Compare(compare,DateTime.Now); if(resul>0) Label6.Text = ("you have not born yet");
if (DOB.CompareTo(DateTime.Now) > some_integer_value) { //your required message }
if(DOB.Date > DateTime.Now.Date) //Now holds time as well. { Label6.Text = ("you have not born yet"); }
Try This.... It working.... if (DateTime.Compare(FromDate.SelectedDateValue, DateTime.Now) > 0) { Label6.Text ="you have not born yet"; }
DateTime val; if(!DateTime.TryParse(SelectedDate, out val)) Console.WriteLine("error"); else if(val.Ticks - DateTime.Now.Ticks > 0) Label6.Text = ("you have not born yet");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)