Java Parse Date parseDate(String value, String formater)

Here you can find the source of parseDate(String value, String formater)

Description

parse Date

License

Apache License

Declaration

public static Date parseDate(String value, String formater) 

Method Source Code


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

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

import java.util.Date;

public class Main {
    public final static SimpleDateFormat sdf = new SimpleDateFormat();

    public static Date parseDate(String value, String formater) {
        Date date = null;//from   w  ww .  j  a  v  a2s .  c  o m
        sdf.applyPattern(formater);
        try {
            date = sdf.parse(value);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }
}

Related

  1. parseDate(String value)
  2. parseDate(String value)
  3. parseDate(String value)
  4. parseDate(String value)
  5. parseDate(String value, Class targetType, String... formats)
  6. parseDate(String value, String pattern)
  7. parseDate2String(Date date)
  8. parseDate4UrlCreateTime(String dateStr)
  9. parseDateAllowNull(String date)