Java Parse Date parseDate(String dateFormat, String value)

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

Description

parse Date

License

Open Source License

Declaration

public static Date parseDate(String dateFormat, String value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

import java.util.Date;
import java.util.TimeZone;

public class Main {
    public static TimeZone IST = TimeZone.getTimeZone("IST");

    public static Date parseDate(String dateFormat, String value) {
        try {//  ww  w. ja va2  s  . c o  m
            SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
            formatter.setTimeZone(IST);
            return formatter.parse(value);
        } catch (ParseException e) {
            return null;
        }
    }
}

Related

  1. parseDate(String date, String pattern)
  2. parseDate(String date, String pattern)
  3. parseDate(String date, String pattern, TimeZone zone)
  4. parseDate(String dateAsString)
  5. parseDate(String dateAsString)
  6. parseDate(String dateOfString, String targetFormat)
  7. parseDate(String dateStr)
  8. parseDate(String datestr)
  9. parseDate(String dateStr)