Here you can find the source of getAsString(Calendar date)
public static String getAsString(Calendar date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static SimpleDateFormat df = new SimpleDateFormat( "dd-MM-yyyy HH:mm"); public static String getAsString(Calendar date) { return df.format(date.getTime()); }//from ww w .ja va 2 s . c o m }