I want to perform this date check:
The date entered by the user should not be less than 12 months ago from the current date, e.g.
if date_value > '03-apr-2009'
How do I write .NET code to do this?
I want to perform this date check:
The date entered by the user should not be less than 12 months ago from the current date, e.g.
if date_value > '03-apr-2009'
How do I write .NET code to do this?
do you mean something like:
if(date_value > DateTime.Now.AddYears(-1))
{
//enter code here
}
date_value which i'm entering is in string format
[ as i did casting already as *( (System.DateTime)date_value).ToString("dd-MMM-yyyy")* ]
so now i want to make a comparision with this string (date_value) and DateTime.Now.AddYears(-1))
so can two strings be compared as such ???? (if one date value is > than the other)
OR Should i do any casting for the comparision ?