Here you can find the source of stringToDateInTimeZone(String time, String timeZone)
public static Date stringToDateInTimeZone(String time, String timeZone)
//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 Date stringToDateInTimeZone(String time, String timeZone) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMddHHmm"); dateFormat.setTimeZone(TimeZone.getTimeZone(timeZone)); Date d = null;// w ww .j a v a2 s . com try { d = dateFormat.parse(time); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } return d; } }