Here you can find the source of toStringTH(Date date, String dateFormat)
public static String toStringTH(Date date, String dateFormat)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String toStringTH(Date date) { return toStringTH(date, "dd/MM/yyyy"); }/*from www . j av a 2 s . co m*/ public static String toStringTH(Date date, String dateFormat) { SimpleDateFormat formatter = new SimpleDateFormat(dateFormat, new java.util.Locale("th", "TH")); return formatter.format(date); } public static String toStringTH(java.sql.Date date) { return toStringTH(date, "dd/MM/yyyy"); } public static String toStringTH(java.sql.Date date, String dateFormat) { SimpleDateFormat formatter = new SimpleDateFormat(dateFormat, new java.util.Locale("th", "TH")); return formatter.format(date); } }