Java Date Format As formatDatemhs(java.util.Date date)

Here you can find the source of formatDatemhs(java.util.Date date)

Description

format Datemhs

License

Apache License

Declaration

public static String formatDatemhs(java.util.Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

public class Main {
    public static String formatDatemhs(java.util.Date date) {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return df.format(date);
    }/*ww  w . java 2 s  .c o  m*/

    public static String format(java.util.Date date) {
        return date == null ? "" : format(date, "yyyy-MM-dd");
    }

    public static String format(java.util.Date date, String pattern) {
        return date == null ? "" : new SimpleDateFormat(pattern).format(date);
    }
}

Related

  1. formatDateHeader(final Date date)
  2. formatDateHMS(java.util.Date date)
  3. formatDateHMSMZ(Date date)
  4. formatDateList(List dateList)
  5. formatDateMedium(Date date)
  6. formatDateMonth(Date d)
  7. formatDateRfc822(Date date)
  8. formatDateStamp(final Date date)
  9. formatDateSwedish(Date date)