Here you can find the source of getDateYYMMDD(java.util.Date date)
public static String getDateYYMMDD(java.util.Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getDateYYMMDD(java.util.Date date) { if (date == null) return ""; SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd"); String NDate = formatter.format(date); return NDate; }/* ww w.j ava2s . c o m*/ public static String getDateYYMMDD() { SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd"); String NDate = formatter.format(new Date()); return NDate; } public static String format(Date date) { return format(date, "yyyy-MM-dd HH:mm:ss"); } public static String format(Date date, String pattern) { return new SimpleDateFormat(pattern).format(date); } }