Creating java date object from year,month,day

前端 未结 6 1054
长情又很酷
长情又很酷 2020-11-27 14:50
int day = Integer.parseInt(request.getParameter(\"day\"));  // 25
int month = Integer.parseInt(request.getParameter(\"month\")); // 12
int year = Integer.parseInt(re         


        
6条回答
  •  时光取名叫无心
    2020-11-27 15:14

    See JavaDoc:

    month - the value used to set the MONTH calendar field. Month value is 0-based. e.g., 0 for January.

    So, the month you set is the first month of next year.

提交回复
热议问题