Here you can find the source of calendarToString(Calendar calendar)
public static String calendarToString(Calendar calendar)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Locale; public class Main { public static final Locale LOCAL_ES = new Locale("es", "ES"); public static final String FORMAT_PATTERN = "MMMMM d, yyyy"; public static String calendarToString(Calendar calendar) { return (new SimpleDateFormat(FORMAT_PATTERN, LOCAL_ES)).format(calendar.getTime()); }/*from ww w . j a v a2 s . com*/ public static String calendarToString(Calendar calendar, String pattern) { return (new SimpleDateFormat(pattern, LOCAL_ES)).format(calendar.getTime()); } }