Here you can find the source of toDate(Calendar date)
public static String toDate(Calendar date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static final SimpleDateFormat sdfDate = new SimpleDateFormat( "dd/MM/yyyy"); public static String toDate(Calendar date) { String dateFormatted = ""; if (date != null) { dateFormatted = sdfDate.format(date.getTime()); }/*from w ww .j ava2 s.c om*/ return dateFormatted; } }