Thursday, October 20, 2011

Java-Date

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;


public class Test {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int year = 2009;
int month = 7; // January
int day = 1;

for (int i=0; i<100; i++) {
day++;
Calendar cal = Calendar.getInstance();
cal.clear();

cal.set(Calendar.YEAR, year);
cal.set(Calendar.MONTH, month);
cal.set(Calendar.DAY_OF_MONTH, day);

java.util.Date utilDate = cal.getTime();
System.out.println(utilDate);
}

}

}