Java tutorial
import java.text.DateFormat; import java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static void main(String args[]) { Date date = new Date(); Format formatter = new SimpleDateFormat("dd/MM/yyyy"); String s = formatter.format(date); System.out.println(s); date = new Date(); String df = DateFormat.getDateInstance().format(date); System.out.println(df); } }