Java Year Format formatMdDdYySlashed(Date date)

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

Description

Formats a date object to "MM/dd/yy".

License

LGPL

Parameter

Parameter Description
date a parameter

Declaration

public static String formatMdDdYySlashed(Date date) 

Method Source Code

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

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**/*  www.j  a  va2s  .  c  om*/
     * Formats a date object to "MM/dd/yy".
     * 
     * @param date
     * @return
     * @author shinobu
     * @since RELEASE4-12
     */
    public static String formatMdDdYySlashed(Date date) {
        if (date == null) {
            return "";
        }
        return formatSlashedMmDdYy().format(date);
    }

    /** DateFormat for "MM/dd/yy". */
    public static DateFormat formatSlashedMmDdYy() {
        return new SimpleDateFormat("MM/dd/yy");
    }
}

Related

  1. format(String day, String month, String year, Locale locale)
  2. format2yyyyMMdd(Date date)
  3. format_D_MM_YYYY_HH_MM(Date date)
  4. formateDate2yyyyMMdd()
  5. formatInyyyyMMdd(java.util.Date date)
  6. formatMmDdYyyy(final Date date)
  7. formatMonth(int timeInfo, String yearInfo)
  8. formatNanosYearGMT(long nanos)
  9. formatSlashedMmDdYy()