Here you can find the source of formatDate(ArrayList list)
public static String formatDate(ArrayList list)
//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); } }