Why Java Calendar set(int year, int month, int date) not returning correct date? [duplicate]

This question already has an answer here:

According to doc, calendar set() is:

http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html#set%28int,%20int,%20int%29

set(int year, int month, int date) 
Sets the values for the calendar fields YEAR, MONTH, and DAY_OF_MONTH.

code:

Calendar c1 = GregorianCalendar.getInstance();
c1.set(2000, 1, 30);  //January 30th 2000
Date sDate = c1.getTime();

System.out.println(sDate);

output:

Wed Mar 01 19:32:21 JST 2000

Why it's not Jan 30 ???

54
задан Tuan Dang 22 May 2014 в 23:35
поделиться