Here you can find the source of calToString(Calendar cal)
static String calToString(Calendar cal)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { static String calToString(Calendar cal) { // java.text.SimpleDateFormat f = new java.text.SimpleDateFormat("MM/dd/yyyy"); DateFormat f = SimpleDateFormat.getDateInstance(DateFormat.SHORT); return f.format(cal.getTime()); }//from www. j a v a 2s .c o m }