Java Calendar to String dateToString(Calendar date, DateFormat format)

Here you can find the source of dateToString(Calendar date, DateFormat format)

Description

date To String

License

Apache License

Declaration

public static String dateToString(Calendar date, DateFormat format) 

Method Source Code


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

import java.text.DateFormat;

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

public class Main {
    public static final DateFormat FORMAT_DATE = new SimpleDateFormat("dd/MM/yyyy");

    public static String dateToString(Calendar date) {
        return dateToString(date, FORMAT_DATE);
    }/*w w w  . ja v  a  2 s  .  c om*/

    public static String dateToString(Calendar date, DateFormat format) {
        if (date == null)
            return null;
        return format.format(date.getTime());
    }
}

Related

  1. calendarToString(Calendar calendar, String template)
  2. calendarToString(Calendar date, boolean transformToLocalTime)
  3. CalendarToString(Calendar fecha, String formato)
  4. calendarToXSDString(Calendar cal, String fmt)
  5. dateToCalendar(final String date)
  6. getDateString(Calendar cal)
  7. getDateString(Calendar cal)
  8. getDateString(Calendar calendar)
  9. getDateToString(Calendar argCal)