Here you can find the source of getCurrentDate(Date date)
public static Date getCurrentDate(Date date)
//package com.java2s; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date getCurrentDate(Date date) { DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); try {//from w w w . java2s . c om return df.parse(df.format(date)); } catch (ParseException e) { return date; } } }