// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class OneDayBack {
    public static void main(String[] args) {
        DateFormat df = new SimpleDateFormat("yyMMdd", new Locale("da", "DK"));
        System.out.println(df.format(new Date()));
        long t = (new Date()).getTime();
        t -= (24*60*60*1000);
        System.out.println(df.format(new Date(t)));
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DAY_OF_MONTH, -1);
        System.out.println(df.format(cal.getTime()));
    }
}
