Here you can find the source of format(Date date)
Parameter | Description |
---|---|
date | the date object to be formatted. |
public static String format(Date date)
import android.util.Log; import com.archee.picturedownloader.PictureDownloader; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main{ public static final SimpleDateFormat DEFAULT_FORMATTER = new SimpleDateFormat( "yyyy-MM-dd HH:mm"); /**/* ww w .ja v a 2s . c o m*/ * Converts a java.util.Date object to a string using the defined default format yyyy-MM-dd HH:mm * @param date the date object to be formatted. * @return the formatted date string. */ public static String format(Date date) { return DEFAULT_FORMATTER.format(date); } }