Here you can find the source of today(String pattern)
Parameter | Description |
---|---|
pattern | a parameter |
public static String today(String pattern)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { /**//from w w w. ja v a2 s.c o m * @param pattern * @return */ public static String today(String pattern) { Calendar calendar = Calendar.getInstance(); SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); return dateFormat.format(calendar.getTime()); } }