Java Calendar Format format(Calendar calendar)

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

Description

format

License

Open Source License

Declaration

public static String format(Calendar calendar) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");

    public static String format(Calendar calendar) {
        if (calendar == null) {
            return null;
        }//from   w  w w  . j  a v a2  s  .c  om
        return DATE_FORMAT.format(calendar.getTime());
    }
}

Related

  1. format(Calendar cal, String format)
  2. format(Calendar cal, String pattern)
  3. format(Calendar calendar)
  4. format(Calendar calendar)
  5. format(Calendar calendar)
  6. format(Calendar calendar)
  7. format(Calendar calendar)
  8. format(Calendar calendar, String format)
  9. format(Calendar calendar, String format)