I am setting the date to 2013-01-01 00:00:00, but the date comes out as Fri Feb 01 00:00:00 GMT+01:00 2013
Why?
Calendar calendar = Calendar.getInstance();
calendar.set(2013, 1, 1, 0, 0, 0);
Date startDate = calendar.getTime();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Month numbering starts at 0 in Java’s date classes. Use the month constants in the
Calendarclass to avoid this common mistake.