Here you can find the source of getYearMonth()
public static String getYearMonth()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; public class Main { public static String getYearMonth() { String yearMonth = ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); yearMonth = sdf.format(new java.util.Date()); return yearMonth; }/*from www. j a v a 2s.c o m*/ }