// 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.GregorianCalendar;

public class TimeFun {
    public static void main(String[] args) {
        DateFormat df = new SimpleDateFormat("dd MMM yyyy G");
        Calendar cal = new GregorianCalendar();
        cal.set(Calendar.YEAR, 1);
        cal.set(Calendar.MONTH, Calendar.JANUARY);
        cal.set(Calendar.DAY_OF_MONTH, 1);
        System.out.println(df.format(cal.getTime()));
        cal.add(Calendar.DAY_OF_MONTH, -1);
        System.out.println(df.format(cal.getTime()));
    }
}
