CalendarManipulation.java Source code

Java tutorial

Introduction

Here is the source code for CalendarManipulation.java

Source

import java.text.DateFormat;
import java.util.Calendar;

public class CalendarManipulation {
    public static void main(String s[]) {
        Calendar cal = Calendar.getInstance();
        DateFormat df = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.MEDIUM);

        System.out.println(df.format(cal.getTime()));

        cal.add(Calendar.DATE, 8);
        System.out.println(df.format(cal.getTime()));
    }
}