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(
Month numbering starts at 0 in Java's date classes. Use the month constants in the Calendar class to avoid this common mistake.
calendar.set(2013, Calendar.JANUARY, 1, 0, 0, 0);