Here you can find the source of parseDateString(TimeZone tz, String dateString)
public static Date parseDateString(TimeZone tz, String dateString)
//package com.java2s; // Licensed to the Apache Software Foundation (ASF) under one import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static Date parseDateString(TimeZone tz, String dateString) { return parseDateString(tz, dateString, "yyyy-MM-dd HH:mm:ss"); }/*w w w. j ava2 s. co m*/ public static Date parseDateString(TimeZone tz, String dateString, String formatString) { DateFormat df = new SimpleDateFormat(formatString); df.setTimeZone(tz); try { return df.parse(dateString); } catch (ParseException e) { throw new IllegalArgumentException(e); } } }