Java Date Format convertDateToMMDDYYYY(Date date)

Here you can find the source of convertDateToMMDDYYYY(Date date)

Description

Converts a date object into MM/dd/YYYY.

License

Open Source License

Parameter

Parameter Description
date the date

Declaration

public static String convertDateToMMDDYYYY(Date date) 

Method Source Code

//package com.java2s;
/** //  w w  w. j  av  a  2  s.c o  m
 *  Copyright (C) 2012  Just Do One More
 *  
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

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

    /**
     * Converts a date object into MM/dd/YYYY.
     * 
     * @param date
     *            the date
     * @return
     */
    public static String convertDateToMMDDYYYY(Date date) {
        return MMDDYYYYFormat.format(date);
    }
}

Related

  1. convertDateToDateString(Date date)
  2. convertDateToFileName(final Date datum)
  3. convertDateToGMTDateString(Date date)
  4. convertDateToHour(Date d)
  5. convertDateToISO8601(Date date)
  6. convertDateToRpcFormat(Date date)
  7. convertDateToString(Date aDate)
  8. convertDateToString(Date aDate)
  9. convertDateToString(Date date)