Android Long to Date Convert isAtMostNMonthsAgo(long date, int howMany)

Here you can find the source of isAtMostNMonthsAgo(long date, int howMany)

Description

is At Most N Months Ago

Declaration

public static boolean isAtMostNMonthsAgo(long date, int howMany) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static boolean isAtMostNMonthsAgo(long date, int howMany) {
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.MONTH, -howMany);
        Date d = new Date(date);
        return d.after(cal.getTime());
    }//from w ww .j a  va 2 s  .  c o m
}

Related

  1. getUpdateDateStr(long time)
  2. getUpdateTimeStr(long time)
  3. getYear(long dateTimeMillis)
  4. hrColMin(final long time, final boolean alwaysIncludeHours)
  5. hrColMinColSec(final long time, final boolean alwaysIncludeHours)
  6. isAtMostNWeeksAgo(long date, int howMany)
  7. isYesterday(long date)
  8. isYesterday(long date)
  9. longTimeToDate(long miliseconds)