Android Year Offset Get getOneYearAgo()

Here you can find the source of getOneYearAgo()

Description

get One Year Ago

Declaration

@SuppressLint("SimpleDateFormat")
    public static String getOneYearAgo() 

Method Source Code

//package com.java2s;
import java.text.DateFormat;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import android.annotation.SuppressLint;

public class Main {
    @SuppressLint("SimpleDateFormat")
    public static String getOneYearAgo() {
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -365);
        return dateFormat.format(cal.getTime());

        // return "2000-09-27 09:00:00";
    }/*from w ww.  ja va 2  s. c  om*/
}

Related

  1. deltaTimeCurrentCentury(int year)
  2. hasYearPassed(int year)
  3. yearOffset(Date date, int offset)
  4. yearDays(int y)
  5. getYearMonthDay1()
  6. getYearMonthDay2()
  7. getYear_Second1()