I have a little issue in Java Calendar setting. The problem is I have this code and it returns "1980.09.12."
.
I can change the year and month to whatever I want, but can't change the day.
public class printableBeosztas extends HttpServlet {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd.");
Calendar calHetfo;
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
setDates();
response.getWriter().append(sdf.format(calHetfo.getTime());
}
public void setDates() {
calHetfo = Calendar.getInstance();
calHetfo.set(Calendar.MONTH, 8);
calHetfo.set(Calendar.YEAR, 1980);
calHetfo.set(Calendar.DAY_OF_MONTH, 3);
}
}
Any idea?