Java Parse Date parseDate(String strDate, String format)

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

Description

parse Date

License

Apache License

Declaration

public static Date parseDate(String strDate, String format) throws Exception 

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 Date parseDate(String strDate, String format) throws Exception {
        ParsePosition pos = new ParsePosition(0);
        DateFormat df = new SimpleDateFormat(format);
        Date strtodate = df.parse(strDate, pos);
        return strtodate;
    }/*from w  w w  . j av a  2s  .c o m*/
}

Related

  1. parseDate(String str, String[] parsePatterns)
  2. parseDate(String strDate)
  3. parseDate(String strDate)
  4. parseDate(String strDate)
  5. parseDate(String strDate)
  6. parseDate(String strFormat, String dateValue)
  7. parseDate(String string)
  8. ParseDate(String string, String format)
  9. parseDate(String t)