Java Parse Date parseDateAllowNull(String date)

Here you can find the source of parseDateAllowNull(String date)

Description

parse Date Allow Null

License

Open Source License

Declaration

public static Date parseDateAllowNull(String date) throws ParseException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static Date parseDateAllowNull(String date) throws ParseException {
        DateFormat df = new SimpleDateFormat("dd/MMM/yyyy");
        return (date == null || date.isEmpty()) ? null : df.parse(date);
    }//w ww . j ava2 s.  c o  m
}

Related

  1. parseDate(String value, Class targetType, String... formats)
  2. parseDate(String value, String formater)
  3. parseDate(String value, String pattern)
  4. parseDate2String(Date date)
  5. parseDate4UrlCreateTime(String dateStr)
  6. parseDateAndGetLong(String date)
  7. parseDateAsString(Date value)
  8. parseDateForFilter(String date)
  9. parseDateFormat(String s, String pattern, TimeZone tz)