Here you can find the source of convertDateIfNecessary(Date date)
public static Date convertDateIfNecessary(Date date)
//package com.java2s; import java.sql.Date; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static Date convertDateIfNecessary(Date date) { if (getPlaceholderDate().equals(date)) { return null; }//from w ww.j av a 2 s . c o m return date; } public static Date getPlaceholderDate() { Calendar cal = GregorianCalendar.getInstance(); return new Date(cal.getTimeInMillis()); } }