Java Calendar Format format(Calendar calendar, String format)

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

Description

format

License

Open Source License

Declaration

public static String format(Calendar calendar, String format) 

Method Source Code


//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {

    public static String format(long t, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(t);
    }/*from  w  w  w.j  a  v a2s.  c o m*/

    public static String format(Calendar calendar, String format) {
        return format(calendar.getTimeInMillis(), format);
    }

    public static String format(Date date, String format) {
        return format(date.getTime(), format);
    }
}

Related

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