Here you can find the source of getTodayFormatted(String pattern)
Parameter | Description |
---|---|
pattern | the pattern (see SimpleDateFormat) |
public static String getTodayFormatted(String pattern)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/*w w w . java 2 s.c o m*/ * Returns the date formatted in given pattern * @param pattern the pattern (see SimpleDateFormat) * @return the formatted date in a String */ public static String getTodayFormatted(String pattern) { SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(new Date()); } }