Here you can find the source of parseDate(String date, String pattern)
public static Date parseDate(String date, String pattern)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static Date parseDate(String date, String pattern) { SimpleDateFormat df = new SimpleDateFormat(pattern); df.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); try {/*from w ww .j a va 2 s . c o m*/ return df.parse(date); } catch (ParseException e) { throw new IllegalArgumentException(e); } } }