Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); public static String calendar2SimpleString(Calendar calendar) { if (calendar != null) { return format2.format(calendar.getTime()); } else { return ""; } } }