Here you can find the source of calendar2string(Calendar calendar, String formatString)
public static String calendar2string(Calendar calendar, String formatString)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String calendar2string(Calendar calendar, String formatString) { return new SimpleDateFormat(formatString) .format(calendar.getTime()); // http://www.javaroad.jp/java_date3.htm }/*from w ww. j av a2s . c o m*/ }