Java Time Parse isFromartDate(String time)

Here you can find the source of isFromartDate(String time)

Description

is Fromart Date

License

Open Source License

Declaration

public static boolean isFromartDate(String time) 

Method Source Code


//package com.java2s;
import java.text.Format;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static boolean isFromartDate(String time) {
        if (time != null) {
            String tmp = null;//from  ww w. j  av  a 2 s .  c  o  m
            try {
                Format f = new SimpleDateFormat("yyyyMMdd");
                Date d = (Date) f.parseObject(time);
                tmp = f.format(d);

            } catch (ParseException e) {
                e.printStackTrace();
            }
            return tmp.equals(time);
        } else {
            return false;
        }
    }
}

Related

  1. getTimeWithStr(String source, String pattern)
  2. getTimeX(String dateStr)
  3. isDateTime(String dateTime)
  4. isDateTime(String dateTime, String pattern)
  5. isDatetimeParsable(String value)
  6. isTime(final String date)
  7. isTime(String timeStr)
  8. strtotime(String strtime)