Here you can find the source of currentDate(int dateStyle)
Parameter | Description |
---|---|
dateStyle | one of DateFormat.SHORT, MEDIUM, LONG, FULL |
public static String currentDate(int dateStyle)
//package com.java2s; import java.text.DateFormat; import java.util.Date; public class Main { /**//from www .j av a 2 s. c o m * Current date as formatted string representation. * * @param dateStyle * one of DateFormat.SHORT, MEDIUM, LONG, FULL * @return the formatted date string. */ public static String currentDate(int dateStyle) { DateFormat df = DateFormat.getDateInstance(dateStyle); return df.format(new Date()); } }