// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.*;
import java.text.*;

public class DateDiff {
    public static void main(String[] args) throws Exception {
        String ds1 = "2007-01-01";
        String ds2 = "2007-12-12";
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date d1 = df.parse(ds1);
        Date d2 = df.parse(ds2);
        int nd = (int) ((d2.getTime() - d1.getTime()) / (24 * 60 * 60 * 1000));
        System.out.println(nd);
    }
}
