Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static long getYesterTime() { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(Calendar.DAY_OF_MONTH, -1); return calendar.getTimeInMillis(); } }