Here you can find the source of getOneYearAgo()
@SuppressLint("SimpleDateFormat") public static String getOneYearAgo()
//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*/ }