Android Year Get getBeforeYear()

Here you can find the source of getBeforeYear()

Description

get Before Year

License

Apache License

Declaration

public static String getBeforeYear() 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String getBeforeYear() {
        String currentYear = getFormatCurrentTime("yyyy");
        int beforeYear = Integer.parseInt(currentYear) - 1;
        return "" + beforeYear;
    }/* w  w w.ja va  2 s.c  o m*/

    public static String getFormatCurrentTime(String format) {
        return getFormatDateTime(new Date(), format);
    }

    public static String getFormatDateTime(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
}

Related

  1. getIndexYear(Date origin, int index)
  2. getCurrentYear()
  3. getCurrentYear()
  4. getCurrentYear()
  5. isInCurrentYear(long lTime)
  6. getCurrentYear()
  7. getYear()
  8. getYearByMillis(long millis)