new Long((dateformat.parse(dateformat.format(new Date(curDay))).getTime()-dateformat.parse(dateformat.format(new Date(t1))).getTime())/(1000 * 60 * 60 * 24)).intValue();
private static void test8() throws Exception{
final DateFormat dateformat = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss",Locale.CHINA);
long h8 = 1000 * 60 * 60 *8;
long h16 = h8*2;
long curDay = System.currentTimeMillis();//此处+ut8是因为可以减少在分区的时候做一次减法
long h24 = h8*3;
curDay = curDay - curDay % h24 + (curDay % h24>=h16?h24:0);
System.out.println(dateformat.format(new Date(curDay)));
long t1 = 1368892799999L;
long m = t1%h24;
long i = (curDay-(t1-m+(m>=h16?h24:0)))/h24;
System.out.println(i);
t1 = 1368892799999L-h24+1;
i = (curDay-(t1-m+(m>=h16?h24:0)))/h24;
System.out.println(i);
t1 = 1368892800000L;
i = (curDay-(t1-m+(m>=h16?h24:0)))/h24;
System.out.println(i);
long d1 = System.currentTimeMillis();
for(int a=0;a<1000;a++){
i=new Long((dateformat.parse(dateformat.format(new Date(curDay))).getTime()-dateformat.parse(dateformat.format(new Date(t1))).getTime())/(1000 * 60 * 60 * 24)).intValue();
System.out.println(i);
}
long d2 = System.currentTimeMillis();
for(int a=0;a<1000;a++){
m = t1%h24;
i = (curDay-(t1-m+(m>=h16?h24:0)))/h24;
System.out.println(i);
}
long d3 = System.currentTimeMillis();
System.out.println(d2-d1);
System.out.println(d3-d2);
}