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

public class AddTimeFun {
    private static void first() {
        Date d1 = new Date();
        Date d2 = new Date(d1.getTime() + 5 * 60 * 1000L);
        System.out.println(d1 + " -> " + d2);
    }
    private static void second() {
        Date d1 = new Date();
        Calendar c = Calendar.getInstance();
        c.setTime(d1);
        c.add(Calendar.MINUTE, 5);
        Date d2 = c.getTime();
        System.out.println(d1 + " -> " + d2);
    }
    public static void main(String[] args) {
        first();
        second();
    }
}
