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

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

Description

is At Most N Weeks Ago

Declaration

public static boolean isAtMostNWeeksAgo(long date, int howMany) 

Method Source Code

//package com.java2s;

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

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

Related

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