Here you can find the source of toString(Calendar c)
public static String toString(Calendar c)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String toString(Calendar c) { return getDateFormat().format(c.getTime()); }/* w w w.ja va 2 s .c o m*/ private static DateFormat getDateFormat() { DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); return formatter; } }