Java Time Parse isDateTime(String dateTime, String pattern)

Here you can find the source of isDateTime(String dateTime, String pattern)

Description

is Date Time

License

Apache License

Declaration

public static boolean isDateTime(String dateTime, String pattern) 

Method Source Code

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

import java.text.DateFormat;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static boolean isDateTime(String dateTime, String pattern) {
        DateFormat df = new SimpleDateFormat(pattern);
        ParsePosition pos = new ParsePosition(0);
        Date dt = df.parse(dateTime, pos);
        return !(dt == null);
    }// w w  w . ja va  2 s.  com
}

Related

  1. getTimeList(String start, String end, int pitch)
  2. getTimeStr(String date1, String date2)
  3. getTimeWithStr(String source, String pattern)
  4. getTimeX(String dateStr)
  5. isDateTime(String dateTime)
  6. isDatetimeParsable(String value)
  7. isFromartDate(String time)
  8. isTime(final String date)
  9. isTime(String timeStr)