on 09-26-2012 12:11 PM
Dear All,
Kindly help me on below.
Requirement: We a have Source field "ValidatyDate" and need to check IF ValidityDate <= ( Systemdate - 365 days) then YES else NO.
Regards,
Manikandan Shanmugam
Hi,
if you want to substract date you just need google for that:
http://www.rgagnon.com/javadetails/java-0101.html
then you can do the compare yourself,
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manikandan
Please try the below code, I think it will solve your issue.
public static long daysBetween(Calendar ValidityDate)
{
Calendar systemDate = Calendar.getInstance();
SimpleDateFormat formatter=
new SimpleDateFormat("yyyy/MMM/dd");
Calendar date = (Calendar) startDate.clone();
long daysBetween = 0;
while (date.before(systemDate))
{
date.add(Calendar.DAY_OF_MONTH, 1);
daysBetween++;
}
If (daysBetween<=365)
return YES;
else return NO;
}
Best Regards,
Sagarika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.