Java Day Count getDaySub(String beginDate, String endDate)

Here you can find the source of getDaySub(String beginDate, String endDate)

Description

get Day Sub

License

Open Source License

Declaration

public static Long getDaySub(String beginDate, String endDate) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

public class Main {

    public static Long getDaySub(String beginDate, String endDate) throws Exception {
        Long days = 0L;/*from ww  w .jav  a  2  s  . c  o  m*/
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
        days = (sdf.parse(endDate).getTime() - sdf.parse(beginDate).getTime()) / (24 * 60 * 60 * 1000);
        return days;
    }
}

Related

  1. getDayCount(String yyyy_mm_dd_1, String yyyy_mm_dd_2)
  2. GetDays(String strStartDate, String strEndDate)
  3. getDaysBetween(Calendar d1, Calendar d2)
  4. getDaysBetween(Map params)
  5. getDaysBetweenTwoDays(String dateFrom, String dateEnd)
  6. getDaySub(String start_time, String end_time)