Java Calendar to String getDateString(Calendar cal)

Here you can find the source of getDateString(Calendar cal)

Description

Returns the current date of the calendar in the m/d/yyyy format as a string

License

Open Source License

Parameter

Parameter Description
cal Description of the Parameter

Return

The dateString value

Declaration

public static String getDateString(Calendar cal) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    /**/*from w  ww.  j  ava  2s  .  co  m*/
     *  Returns the current date of the calendar in the m/d/yyyy format as a
     *  string
     *
     * @param  cal  Description of the Parameter
     * @return      The dateString value
     */
    public static String getDateString(Calendar cal) {
        return (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH) + "/" + cal.get(Calendar.YEAR);
    }
}

Related

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