Here you can find the source of dateFormat(String df, TimeZone timeZone)
public static SimpleDateFormat dateFormat(String df, TimeZone timeZone)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.TimeZone; public class Main { public static SimpleDateFormat dateFormat(String df, TimeZone timeZone) { SimpleDateFormat ret = new SimpleDateFormat(df); ret.setTimeZone(timeZone);//from w w w . ja v a2 s.co m return ret; } }