Here you can find the source of getFormatDate(Date date, boolean ShowTimePart_in)
public static String getFormatDate(Date date, boolean ShowTimePart_in)
//package com.java2s; /**//w w w .ja va 2s .c o m * DateUtil.java ,By AOSA_TECH AOSAProject at 2011-8-11 ????06:53:44 * Copyright (c) 2011, AOSA_TECH, Ltd. All right reserved. * AOSA_TECH PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * @Project AOSAProject * @version V1.0.0 */ import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getFormatDate(Date date, boolean ShowTimePart_in) { if (ShowTimePart_in) { return (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date); } else { return (new SimpleDateFormat("yyyy-MM-dd")).format(date); } } }