Java Parse Date parseDate(String source, String format)

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

Description

parse Date

License

LGPL

Declaration

public static Date parseDate(String source, String format) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

import java.text.ParseException;

public class Main {

    public static Date parseDate(String source, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        try {/*w ww  .  ja  v  a 2  s  . c om*/
            return sdf.parse(source);
        } catch (ParseException e) {
            return null;
        }
    }
}

Related

  1. parseDate(String sDate, SimpleDateFormat _dateFormat)
  2. parseDate(String sDate, String sFormat)
  3. parseDate(String sDate, String sSourceFormat, String sDestinationFormat)
  4. parseDate(String sdate, String timeFormat, String timeZone)
  5. parseDate(String sDateTime, String sPattern)
  6. parseDate(String src, String pattern)
  7. parseDate(String srtDate, String pattern)
  8. parseDate(String str)
  9. parseDate(String str)