Here you can find the source of parseCalendar2String(Calendar calendar)
public static String parseCalendar2String(Calendar calendar)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static final String PATTERN = "yyyy-MM-dd"; public static String parseCalendar2String(Calendar calendar, String pattern) { return parseDate2String(calendar.getTime(), pattern); }//from www . j ava 2 s. c om public static String parseCalendar2String(Calendar calendar) { return parseCalendar2String(calendar, null); } public static String parseDate2String(Date date, String pattern) { return getSimpleDateFormatInstance(pattern).format(date); } public static String parseDate2String(Date date) { return parseDate2String(date, null); } private static SimpleDateFormat getSimpleDateFormatInstance(String pattern) { return new SimpleDateFormat(pattern == null ? PATTERN : pattern); } }