Here you can find the source of parseDate(String str, String timezone)
public static final Date parseDate(String str, String timezone)
//package com.java2s; /*/* w w w. j av a 2s . c om*/ * ==================================================================== * Copyright (c) 2004 TMate Software Ltd. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://tmate.org/svn/license.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * ==================================================================== */ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { private static final DateFormat ISO8601_FORMAT_IN = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy"); public static final Date parseDate(String str, String timezone) { if (timezone != null) { ISO8601_FORMAT_IN.setTimeZone(TimeZone.getTimeZone(timezone)); } if (str == null) { return new Date(0); } try { return ISO8601_FORMAT_IN.parse(str); } catch (Throwable e) { } return new Date(0); } }