Java Date Format formatDate(ArrayList list)

Here you can find the source of formatDate(ArrayList list)

Description

format Date

License

Mozilla Public License

Declaration

public static String formatDate(ArrayList list) 

Method Source Code

//package com.java2s;
/**/*from   w w w  . j av  a  2  s  . c  om*/
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;

public class Main {
    public static String formatDate(ArrayList list) {
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, (int) list.get(0));
        cal.set(Calendar.MONTH, (int) list.get(1) - 1);
        cal.set(Calendar.DAY_OF_MONTH, (int) list.get(2));
        Date date = cal.getTime();
        DateFormat requiredFormat = new SimpleDateFormat("dd MMMM YYYY");
        return requiredFormat.format(date);
    }
}

Related

  1. dateTimeToMillis(String dateTime, String format)
  2. dateTimeToStr(Date date, String format)
  3. dateTimeToZuluFormat(DateTime dateTime)
  4. formatD(Date date)
  5. formatDashedDateDDMMYYYY(Date date)
  6. formatDate(Date _date)
  7. formatDate(Date aDate)
  8. formatDate(Date d)
  9. formatDate(Date d)