Here you can find the source of getTodaysDate(String dateFormat)
public static String getTodaysDate(String dateFormat)
//package com.java2s; import java.util.*; public class Main { /** //w w w . j a va2 s. c o m * Get today's date and return it in the right format */ public static String getTodaysDate(String dateFormat) { SimpleDateFormat timeFormat = new SimpleDateFormat(dateFormat); timeFormat.setTimeZone(TimeZone.getDefault()); return timeFormat.format(new Date()); } }