Here you can find the source of parseDate(String dateFormat, String value)
public static Date parseDate(String dateFormat, String value)
//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; } } }