Java Yesterday getYesterday()

Here you can find the source of getYesterday()

Description

get Yesterday

License

Apache License

Declaration

public static String getYesterday() 

Method Source Code

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

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

public class Main {
    public static String getYesterday() {
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -1);
        String yesterday = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
        return yesterday;
    }//from  w  w w.  ja  v a2s .c  o m
}

Related

  1. getYesterday()
  2. getYesterday()
  3. getYesterday()
  4. getYesterday()
  5. getYesterday()
  6. getYesterDay()
  7. getYesterday()