Java Calendar Day getDaysFromThen(Calendar aDate)

Here you can find the source of getDaysFromThen(Calendar aDate)

Description

get Days From Then

License

Open Source License

Declaration

public static Long getDaysFromThen(Calendar aDate) 

Method Source Code


//package com.java2s;
/*//from w  w  w .ja v  a2 s.  c  o m
 * DateUtils.java
 * Copyright (c) 2009, Monte Alto Research Center, All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Monte Alto Research Center ("Confidential Information"). You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Monte Alto Research Center
 */

import java.util.Calendar;

public class Main {
    public static Long getDaysFromThen(Calendar aDate) {
        long now = Calendar.getInstance().getTimeInMillis();
        long then = aDate.getTimeInMillis();
        long diffInMillis = now - then;
        return new Long(diffInMillis / 86400000);
    }
}

Related

  1. getDay(Calendar calendar)
  2. getDay(Calendar calendar)
  3. getDayEndCalendar(Calendar cal)
  4. getDayName(Calendar cal)
  5. getDayOfPeriod(Calendar cal, long timems)
  6. getDayStr(Calendar cal)
  7. getDayString(Calendar cal1)
  8. getDayStringByCalendar(Calendar calendar)
  9. getEndDay(Calendar cal)