Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String getDateString(Date value, String format) { String result = null; if (null != value) { SimpleDateFormat dateFormat = new SimpleDateFormat(format, Locale.CHINA); try { result = dateFormat.format(value); } catch (Exception e) { e.printStackTrace(); } } return result; } }