Here you can find the source of convertToShortMonth(Date date)
public static Date convertToShortMonth(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date convertToShortMonth(Date date) { if (date == null) { return null; }//w w w .j ava2 s . co m Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.DAY_OF_MONTH, 1); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTime(); } }