Here you can find the source of formatMM(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static String formatMM(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private final static ThreadLocal<SimpleDateFormat> YYYY_MM_DD_HH_MM_FORMAT = new ThreadLocal<SimpleDateFormat>() { @Override//from ww w .ja v a2 s .c om protected SimpleDateFormat initialValue() { return new SimpleDateFormat("yyyy-MM-dd HH:mm"); } ; }; /** * yyyy-MM-dd HH:mm * * @param date * @return */ public static String formatMM(Date date) { return YYYY_MM_DD_HH_MM_FORMAT.get().format(date); } }