Android Day Get getDaysTo(Date date)

Here you can find the source of getDaysTo(Date date)

Description

get Days To

License

Open Source License

Declaration

public static int getDaysTo(Date date) 

Method Source Code

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

import java.util.Date;

public class Main {
    private static final long ONE_DAY_IN_MILLIS = 24 * 60 * 60 * 1000;

    public static int getDaysTo(Date date) {
        return (int) ((date.getTime() - getCurrentEpochTime()) / ONE_DAY_IN_MILLIS);
    }//from  ww  w  .jav  a  2s . c  o m

    private static long getCurrentEpochTime() {
        return new Date().getTime();
    }
}

Related

  1. isBirthday(Calendar cal)
  2. getBeforeDate(Date date, int days)
  3. getAfterDate(Date date, int days)
  4. fromJulianDay(double julianDay)
  5. getTimeNextDay(long lTimeMillis)
  6. intDayToString(int day)
  7. leapDays(int y)
  8. getDay()
  9. dayIndexToDate(int dayindex)