Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static int currentYear = 0; private static SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM d, yyyy"); public static String getCurrentDateString() { Calendar currentCalendar = Calendar.getInstance(); currentYear = currentCalendar.get(Calendar.YEAR); return dateFormat.format(currentCalendar.getTimeInMillis()); } }