Java Calendar to String calendarToString(Calendar calendar)

Here you can find the source of calendarToString(Calendar calendar)

Description

calendar To String

License

Open Source License

Declaration

public static String calendarToString(Calendar calendar) 

Method Source Code


//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());
    }
}

Related

  1. calendarToString(Calendar c)
  2. calendarToString(Calendar c, String format)
  3. calendarToString(Calendar cal)
  4. calendarToString(Calendar cal)
  5. calendarToString(Calendar cal, String format)
  6. calendarToString(Calendar calendar)
  7. calendarToString(Calendar calendar)
  8. calendarToString(Calendar calendar, String template)
  9. calendarToString(Calendar date, boolean transformToLocalTime)