Java Time Format getFormatDate(Date date, boolean ShowTimePart_in)

Here you can find the source of getFormatDate(Date date, boolean ShowTimePart_in)

Description

get Format Date

License

Open Source License

Declaration

public static String getFormatDate(Date date, boolean ShowTimePart_in) 

Method Source Code

//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);
        }
    }
}

Related

  1. getCurTime(String dateformat)
  2. getDefaultDatetimeFormat()
  3. getDefaultPropertyPageDateTimeFormat()
  4. getEndDate(String time, SimpleDateFormat dateFormat)
  5. getFormat2TimetagStr()
  6. getFormatDate(String timeString, String format)
  7. getFormatDatetime()
  8. getFormatDateTime(Date date)
  9. getFormatDateTime(Date date, String format)