Here you can find the source of formatDate(Date in)
Parameter | Description |
---|---|
in | a parameter |
public static String formatDate(Date in)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/* w w w . ja v a 2 s.c o m*/ * Formats a date in teh format yyyy-MM-dd * * @param in * @return formatted date */ public static String formatDate(Date in) { if (in == null) { return null; } DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); return dateFormat.format(in); } }