Java Date Format As formatDateToMD(Date date)

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

Description

format Date To MD

License

Open Source License

Declaration

public static String formatDateToMD(Date date) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2005, 2006 IBM Corporation and others. All rights reserved. This program and the
 * accompanying materials are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * /* w  ww .java  2  s  . c o  m*/
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;

public class Main {
    public static String formatDateToMD(Date date) {
        SimpleDateFormat fmt = new SimpleDateFormat("dd/MM", Locale.CHINA);
        return fmt.format(date);
    }

    public static String formatDateToMD(Date date, String pattern) {
        SimpleDateFormat fmt = new SimpleDateFormat(pattern, Locale.CHINA);
        return fmt.format(date);
    }
}

Related

  1. formatDateStamp(final Date date)
  2. formatDateSwedish(Date date)
  3. formatDateTd(Object obj)
  4. formatDateToday()
  5. formatDateToDefault(Date date)
  6. formatDateToMinutes(Date date)
  7. formatDateToUTC(Date date)
  8. formatDateToUTC(final Date date)
  9. formatDateUsingW3C(Date date)