Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; public class Main { public static String getDateTimeYYmm() { String paramFormat = "yyyy-MM-dd"; SimpleDateFormat sdf = new SimpleDateFormat(paramFormat); return sdf.format(System.currentTimeMillis()).toString(); } }