Java Date Format formatDate(Date fecha)

Here you can find the source of formatDate(Date fecha)

Description

format Date

License

Open Source License

Declaration

public static String formatDate(Date fecha) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String formatDate(Date fecha) {
        if (fecha == null)
            fecha = new Date();
        SimpleDateFormat formatoDelTexto = new SimpleDateFormat("yyyy/MM/dd");
        return formatoDelTexto.format(fecha);//que formatee la fecha en el formato anterior

    }/* w  w  w. j  a  v a2s .  c o  m*/
}

Related

  1. formatDate(Date date)
  2. formatDate(Date date)
  3. formatDate(Date date, DateFormat dateFormat, char delimiter, boolean endWithDelimiter)
  4. formatDate(Date date, Locale locale)
  5. formatDate(Date date, SimpleDateFormat dateFormat)
  6. formatDate(Date in)
  7. formatDate(Date myDate)
  8. formatDate(Date pDate, boolean pShowDateOnly)
  9. formatDate(Date t)