Java Day Of Year getLastYearOfToday()

Here you can find the source of getLastYearOfToday()

Description

get Last Year Of Today

License

Apache License

Declaration

public static Date getLastYearOfToday() 

Method Source Code

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

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

public class Main {

    public static Date getLastYearOfToday() {
        return rollYear(new Date(), -1);
    }/*w w  w.j  a va 2 s.  c o m*/

    public static Date rollYear(Date date, int rollCount) {
        Calendar ca = Calendar.getInstance();
        ca.setTime(date);
        ca.roll(Calendar.YEAR, rollCount);
        return ca.getTime();
    }
}

Related

  1. getDaysInYear(int year)
  2. getDaysOfYear(int year)
  3. getEndTimeOfYear(int year)
  4. getFirstDayOfTheYear(int year)
  5. getFirstDayOfYear(int year)
  6. getMaxDayByYearMonth(String ym)
  7. getMaxDayOfYearMonth(String date)
  8. getMaxWeekNumOfYear(int year)