Here you can find the source of getYesterdayString()
public static String getYesterdayString()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static SimpleDateFormat yyyyMMddHH_NOT_ = new SimpleDateFormat("yyyyMMdd"); public static long DATEMM = 86400L; public static String getYesterdayString() { Date date = new Date(System.currentTimeMillis() - DATEMM * 1000L); String str = yyyyMMddHH_NOT_.format(date); return str; }/*from w w w . j av a 2 s .c o m*/ }