Here you can find the source of getTwoDay2String(String startDate, String endDate, Format format)
public static String getTwoDay2String(String startDate, String endDate, Format format)
//package com.java2s; //License from project: Apache License import java.text.Format; import java.text.SimpleDateFormat; public class Main { public static String getTwoDay2String(String startDate, String endDate, Format format) { SimpleDateFormat localFormat = (SimpleDateFormat) format; long day = 0; try {//www.jav a2s. c om java.util.Date startDay = localFormat.parse(startDate); java.util.Date endDay = localFormat.parse(endDate); day = (endDay.getTime() - startDay.getTime()) / (24 * 60 * 60 * 1000); } catch (Exception e) { return ""; } return day + ""; } }