Here you can find the source of getTimeByCustomPattern(Date date, String pattern)
public static String getTimeByCustomPattern(Date date, String pattern)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTimeByCustomPattern(Date date, String pattern) { return new SimpleDateFormat(pattern).format(date); }/*from w w w . j a v a2 s . c om*/ }