Here you can find the source of getCurrentDate(String pattern)
Parameter | Description |
---|---|
pattern | a parameter |
public static String getCurrentDate(String pattern)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getCurrentDate(String pattern) { String result;/* www . j ava 2 s . com*/ SimpleDateFormat formatter = new SimpleDateFormat(pattern); result = formatter.format(new Date()); return result; } }