Java Day Count getDaySub(String start_time, String end_time)

Here you can find the source of getDaySub(String start_time, String end_time)

Description

get Day Sub

License

Apache License

Declaration

public static long getDaySub(String start_time, String end_time) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {

    public static long getDaySub(String start_time, String end_time) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        long day = 0;
        try {/*w  ww.ja  v a 2s .  c o m*/
            long start_timeStamp = sdf.parse(start_time).getTime();
            long end_timeStamp = sdf.parse(end_time).getTime();
            day = (end_timeStamp - start_timeStamp) / (24 * 60 * 60 * 1000);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return day;

    }
}

Related

  1. GetDays(String strStartDate, String strEndDate)
  2. getDaysBetween(Calendar d1, Calendar d2)
  3. getDaysBetween(Map params)
  4. getDaysBetweenTwoDays(String dateFrom, String dateEnd)
  5. getDaySub(String beginDate, String endDate)