Android Today Get getLastyearToday(String str)

Here you can find the source of getLastyearToday(String str)

Description

get Lastyear Today

Declaration

public static String getLastyearToday(String str) 

Method Source Code

//package com.java2s;

public class Main {
    public static String lastYearToday;

    public static String getLastyearToday(String str) {

        String subYear = str.substring(0, 4);
        String subMonth = str.substring(5, 7);
        String subDay = str.substring(8, 10);

        Long LongYear = new Long(subYear);
        long longYear = LongYear.longValue();
        longYear--;//  w w  w.  ja v  a 2  s.  co m
        lastYearToday = longYear + "-" + subMonth + "-" + subDay;
        return lastYearToday;
    }
}

Related

  1. getToday()
  2. getTodayFull()
  3. isToday(Calendar today, Calendar date)
  4. isToday(Calendar date)
  5. getNbDaysToDate(Calendar from, int toYear, int toMonth, int toDay)