Java Time Format isDateFormat(String timeString)

Here you can find the source of isDateFormat(String timeString)

Description

is Date Format

License

Apache License

Declaration

public static boolean isDateFormat(String timeString) 

Method Source Code

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

import java.text.SimpleDateFormat;

public class Main {

    public static boolean isDateFormat(String timeString) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        format.setLenient(false);/*w  ww.j  a  v a  2s. c om*/
        try {
            format.parse(timeString);
        } catch (Exception e) {
            return false;
        }
        return true;
    }
}

Related

  1. getTimeSystem(String formatTime)
  2. getTwoTimeInterval(String startTime, String endTime, String format)
  3. getUniversalDateTimeFormat()
  4. getXsdDateTimeFormat()
  5. getXSDFormatter(DateTime date)
  6. long2Datestr(long time, String format)
  7. long2String(long longTime, String dataFormat)
  8. long2String(long longTime, String dataFormat)
  9. newDateTimeFormat()