Here you can find the source of dateTimeToString(Calendar dateTime)
public static String dateTimeToString(Calendar dateTime)
//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 final DateFormat FORMAT_DATE_TIME = new SimpleDateFormat("dd/MM/yyyy HH:mm"); public static String dateTimeToString(Calendar dateTime) { if (dateTime == null) return null; return FORMAT_DATE_TIME.format(dateTime.getTime()); }/*from w w w . j a v a2 s . c om*/ }