Here you can find the source of toDateString(Date date, TimeZone timezone)
public static String toDateString(Date date, TimeZone timezone)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static String toDateString(Date date, TimeZone timezone) { if (date == null) return null; if (timezone == null) timezone = TimeZone.getDefault(); SimpleDateFormat dbFmt = new SimpleDateFormat("yyyy/MM/dd"); dbFmt.setTimeZone(timezone);//w w w . j a va2s. co m return dbFmt.format(date); } }