Java Calendar Format formatDate(Calendar date)

Here you can find the source of formatDate(Calendar date)

Description

format Date

License

Apache License

Declaration

public static String formatDate(Calendar date) 

Method Source Code


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

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

public class Main {
    private static final SimpleDateFormat DAY_FORMAT = new SimpleDateFormat("dd-MM-yyyy") {
        {/*from ww  w .  j  ava2  s  .  c  o m*/
            setTimeZone(TimeZone.getTimeZone("UTC"));
        }
    };

    public static String formatDate(Calendar date) {
        return DAY_FORMAT.format(date.getTime());
    }
}

Related

  1. formatDate(Calendar cal)
  2. formatDate(Calendar cal)
  3. formatDate(Calendar cal)
  4. formatDate(Calendar calendar)
  5. formatDate(Calendar date)
  6. formatDate(Calendar date)
  7. formatDate(Calendar date, int precision)
  8. FormatDate(Calendar p_date, String p_separator)
  9. formatDate(String formats, Calendar date)