1
public boolean compDate(String s1,String s2)
{
2
int day=0;
3
SimpleDateFormat sf=new SimpleDateFormat("yyyy-MM-dd");
4
GregorianCalendar calendar1=new GregorianCalendar();
5
GregorianCalendar calendar2=new GregorianCalendar();
6
//String s1="2006-04-21";
7
//String s2="2006-04-25";
8
Date xxx1=new Date();
9
Date xxx2=new Date();
10
try
{
11
xxx1=sf.parse(s1);
12
xxx2=sf.parse(s2);
13
day = (int) ((xxx2.getTime() - xxx1.getTime()) / 3600 / 24 / 1000);
14
} catch (ParseException e)
{
15
// TODO Auto-generated catch block
16
e.printStackTrace();
17
}
18
if(day>10)
{
19
return true;
20
}else
{
21
return false;
22
}
23
}



2

3

4

5

6

7

8

9

10



11

12

13

14



15

16

17

18



19

20



21

22

23
