Java Day daySub(Date fDate, Date oDate)

Here you can find the source of daySub(Date fDate, Date oDate)

Description

day Sub

License

LGPL

Declaration

public static int daySub(Date fDate, Date oDate) 

Method Source Code


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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static int daySub(Date fDate, Date oDate) {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        long to = fDate.getTime();
        long from = oDate.getTime();
        return (int) (to - from) / (1000 * 60 * 60 * 24);
    }//from   w w w.  java2s  .  c  om
}

Related

  1. dayFormat(Date date)
  2. dayOfDate(Date s)
  3. dayOfWeekAbr(Date date)
  4. daysFrom(Date date, int amount, String format)
  5. daysOfnumbe(Date sDate, int number)
  6. daysWeekName(boolean shortName, Locale locale)
  7. dayToMilliSeconds(String day, String timeZone)
  8. dayToUTCSeconds(String day)
  9. getDateYYMMDD()