// 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.util.Calendar;
import java.util.GregorianCalendar;

public class LastFriday {
    public static void main(String[] args) {
        Calendar cal = new GregorianCalendar();
        System.out.println(cal.getTime());
        cal.add(Calendar.DAY_OF_MONTH, -1);
        while(cal.get(Calendar.DAY_OF_WEEK) != Calendar.FRIDAY) {
            cal.add(Calendar.DAY_OF_MONTH, -1);
        }
        System.out.println(cal.getTime());
    }
}
