Java Date Value Check isDataOra(String date)

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

Description

is Data Ora

License

Apache License

Declaration

public static boolean isDataOra(String date) 

Method Source Code


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

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

public class Main {
    private final static SimpleDateFormat _dataOra = new SimpleDateFormat("dd/MM/yyyy - HH:mm");

    public static boolean isDataOra(String date) {
        Date d = toDateTime(date);
        return d != null && _dataOra.format(d).equals(date);
    }/* w w  w.j a  v  a  2 s .  c om*/

    public static Date toDateTime(String date) {
        Date d = null;
        try {
            d = _dataOra.parse(date);
        } catch (Exception e) {

        }
        return d;
    }
}

Related

  1. isData(long date)
  2. isDate(final String date)
  3. isDate(final String date)
  4. isDate(final String dateString)
  5. isDate(final String strDate, final String pattern)