Java yyyy formatString(Date date)

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

Description

Genera una cadena a partir de un objeto Date con una fecha

License

Open Source License

Parameter

Parameter Description
date Objeto Date

Return

Cadena

Declaration

public static String formatString(Date date) 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    public static String FORMATDATE = "yyyy/MM/dd";

    /**/*from   w ww .jav  a 2  s.  c  o  m*/
     * Genera una cadena a partir de un objeto Date con una fecha
     * 
     * @param date Objeto Date
     * @return Cadena
     */
    public static String formatString(Date date) {

        SimpleDateFormat dateFormat = new SimpleDateFormat(FORMATDATE);
        String string = "";
        if (date != null)
            string = dateFormat.format(date);
        return string;
    }
}

Related

  1. formatShortDate(Date date)
  2. formatSimpleDate(Date date)
  3. formatSimpleGermanDateString(Date date)
  4. formatSpaydDate(Date date, TimeZone tz)
  5. formatStr(Date date)
  6. formattedDate(final String format, final Date tweetPollDate)
  7. formatter()
  8. formatTimeSpan(long time)
  9. formatToEapoDate(Date date)