Java SQL Date Create convertDateIfNecessary(Date date)

Here you can find the source of convertDateIfNecessary(Date date)

Description

convert Date If Necessary

License

Open Source License

Declaration

public static Date convertDateIfNecessary(Date date) 

Method Source Code

//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());
    }
}

Related

  1. convertDate(java.sql.Date date)
  2. convertDateFromSQLDate(java.sql.Date sqlDate)
  3. convertDateFromSqlToUtil(java.sql.Date sqlDate)
  4. convertDateFromString(String inputDateString)
  5. convertDateFromUtilToSql(java.util.Date utilDate)
  6. convertDateToString(java.sql.Date argDate)
  7. convertFormat(java.sql.Date dt, String formatter)
  8. convertFormat(String dateData)
  9. convertiFecha(Date utilFecha)