Here you can find the source of getFormatDateString(String format)
public static final String getFormatDateString(String format)
//package com.java2s; public class Main { public static final String getFormatDateString(String format) { java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat( format);//from w w w. j a va 2s . c o m java.util.Date d = new java.util.Date(); return sdf.format(d); } public static final String getFormatDateString(String format, java.util.Date date) { java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat( format); return sdf.format(date); } public static final String getFormatDateString(String format, long date) { java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat( format); return sdf.format(new java.util.Date(date)); } }