Java tutorial
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { static SimpleDateFormat gmtFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.KOREA); public static String convertDateToString(Date d) { try { return gmtFormat.parse(d.toString()).toString(); } catch (ParseException e) { } return null; } }