Java Date Format formatDate(java.util.Calendar in)

Here you can find the source of formatDate(java.util.Calendar in)

Description

convert a Calendar into a readable string

License

Apache License

Parameter

Parameter Description
in non-null Calandar

Return

non-null String

Declaration

public static String formatDate(java.util.Calendar in) 

Method Source Code

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

import java.text.*;

public class Main {
    /**/*from  www  .  j a  va  2  s .  co m*/
     * convert a Calendar into a readable string
     * @param in non-null Calandar
     * @return non-null String
     */
    public static String formatDate(java.util.Calendar in) {
        return (formatDate(in.getTime()));
    }

    /**
     * convert a Date into a readable string
     * @param in non-null Date
     * @return non-null String
     */
    public static String formatDate(java.util.Date in) {
        SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yyyy HH:mm");
        return (fmt.format(in));
    }
}

Related

  1. formatDate(final Date date)
  2. formatDate(final java.util.Date date)
  3. formatDate(final java.util.Date date, final Supplier formatSupplier)
  4. formatDate(int day, int month, int year)
  5. formatDate(Integer day, Integer month, Integer year)
  6. formatDate(java.util.Date date)
  7. formatDate(java.util.Date paramDate)
  8. formatDate(Object obj)
  9. formatDate6(Date date)