Here you can find the source of convertToString(Timestamp dateData, String pattern, Locale locale)
public static String convertToString(Timestamp dateData, String pattern, Locale locale)
//package com.java2s; import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Locale; public class Main { public static String convertToString(Timestamp dateData) { return convertToString(dateData, "yyyy/MM/dd"); }/*from w w w . j a v a2 s .co m*/ public static String convertToString(Timestamp dateData, String pattern) { return convertToString(dateData, pattern, Locale.KOREA); } public static String convertToString(Timestamp dateData, String pattern, Locale locale) { if (dateData == null) { return null; } SimpleDateFormat formatter = new SimpleDateFormat(pattern, locale); return formatter.format(dateData); } }