Here you can find the source of formatarData(String pattern, Date data)
public static String formatarData(String pattern, Date data)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.*; public class Main { public static SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); public static String formatarData(String pattern, Date data) { SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); return dateFormat.format(data); }//from w ww. jav a 2 s .c o m public static String format(Date data) { return sdf.format(data); } }