Java Parse Date parseDate(String dateStr, String format)

Here you can find the source of parseDate(String dateStr, String format)

Description

parse Date

License

Open Source License

Declaration

public static Date parseDate(String dateStr, String format) 

Method Source Code

//package com.java2s;

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

public class Main {

    public static Date parseDate(String dateStr, String format) {
        if (dateStr == null)
            return null;
        SimpleDateFormat formatter = new SimpleDateFormat(format);
        ParsePosition ps = new ParsePosition(0);
        Date date = formatter.parse(dateStr, ps);
        return date;
    }//from  www.j  ava 2  s  .  co  m
}

Related

  1. parseDate(String dateStr)
  2. parseDate(String dateStr, SimpleDateFormat... formats)
  3. parseDate(String dateStr, String dateFormat)
  4. parseDate(String dateStr, String dateFormat)
  5. parseDate(String dateStr, String format)
  6. parseDate(String dateStr, String... formats)
  7. parseDate(String dateString)
  8. ParseDate(String dateString)
  9. parseDate(String dateString)