Java Date Value Check isValidDateInternal(String date, String dateFormat)

Here you can find the source of isValidDateInternal(String date, String dateFormat)

Description

is Valid Date Internal

License

Apache License

Declaration

private static boolean isValidDateInternal(String date, String dateFormat) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

public class Main {
    private static boolean isValidDateInternal(String date, String dateFormat) {
        try {//from www .ja va 2  s.c om
            DateFormat df = new SimpleDateFormat(dateFormat);
            df.setLenient(false);
            df.parse(date);
            return true;
        } catch (ParseException e) {
            return false;
        }
    }
}

Related

  1. isValidDate(String s)
  2. isValidDate(String src, String format)
  3. isValidDate(String value)
  4. isValidDateFormat(String startDate)
  5. isValidDateFormat(String strDate, String dataFormat)
  6. isValidDatePattern(String pattern)
  7. isValidDatePatterns(String dateStr, String patterns)
  8. isValidDateStr(String date, String format)
  9. isValidGameDate(String gameDate)