Java Calendar Format formatCalendar(Calendar calendar)

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

Description

format Calendar

License

Apache License

Declaration

public static String formatCalendar(Calendar calendar) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    public static String DEFAULTFORMAT = "yyyy-MM-dd HH:mm:ss";

    public static String formatCalendar(Calendar calendar) {
        return formatCalendar(calendar, DEFAULTFORMAT);
    }/*w  w  w.  j  a v a 2 s .c o m*/

    public static String formatCalendar(Calendar calendar, String pattern) {
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        //sdf.setTimeZone(TimeZone.getTimeZone(timeZone));
        return sdf.format(calendar.getTime());
    }
}

Related

  1. format(Calendar calendar, String pattern)
  2. format(Calendar current)
  3. format(Calendar self, String pattern)
  4. format(final Calendar cal)
  5. formatarData(Calendar data)
  6. formatCalendar(Calendar calendar)
  7. formatCalendar(Calendar calendar)
  8. formatCalendar(Calendar calendar)
  9. formatCalendar(Calendar objCal, String strFormat)