Here you can find the source of formatString(Date date)
Parameter | Description |
---|---|
date | Objeto Date |
public static String formatString(Date date)
//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; } }