Java yyyy formatFromDate(Date date)

Here you can find the source of formatFromDate(Date date)

Description

format From Date

License

Apache License

Declaration

public static String formatFromDate(Date date) 

Method Source Code


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

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final String FORMATER_YYYY_MM_DD = "yyyy-MM-dd";

    public static String formatFromDate(Date date) {
        return formatFromDate(FORMATER_YYYY_MM_DD, date);
    }/*from w  ww  .j a v a2  s.c o  m*/

    public static String formatFromDate(String formater, Date date) {
        DateFormat df = new SimpleDateFormat(formater);
        return df.format(date);
    }
}

Related

  1. formatDateToString(Date d)
  2. formatDateToString(String strDate)
  3. formatDicomDate(String dicomDate)
  4. formatearDateToString(Date date)
  5. formatFecha(Date fecha)
  6. formatG(Date date)
  7. formatHL7TSFormat4Date(Date time)
  8. formatJJJJMMTT(long time)
  9. formatPGNDate(final Date pDate)