Java examples for java.util:Date Format
get Date yyyyMMddHHmm
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static void main(String[] argv) throws Exception { System.out.println(getDateMMDDHHMI()); }//from w ww . j ava 2 s. co m public static String getDateMMDDHHMI() { SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmm"); String curDate = formatter.format(Calendar.getInstance().getTime()); return curDate; } }