Here you can find the source of getMonthAndDate()
public static String getMonthAndDate()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { /**//ww w . jav a2s.c o m * MM-dd Comment for <code>onlyDateFmt</code> */ public static final SimpleDateFormat mmDDDateFmt = new SimpleDateFormat("MMdd", Locale.CHINA); /** * @return MM-dd */ public static String getMonthAndDate() { return mmDDDateFmt.format(new Date()); } }