Here you can find the source of getMM(Date date)
public static String getMM(Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat DATE_FORMAT2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private static final SimpleDateFormat DATE_FORMAT6 = new SimpleDateFormat("MM"); public static String getMM(Date date) { return DATE_FORMAT6.format(date); }/*www . ja v a 2s. c o m*/ public static String format(Date date) { return DATE_FORMAT2.format(date); } }