Java tutorial
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getCurrentDate() { DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd"); Calendar cal = Calendar.getInstance(); String currentDate = dateFormat.format(cal.getTime()); return currentDate; } }