Here you can find the source of nowDT()
public static String nowDT()
//package com.java2s; //License from project: LGPL import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Map; public class Main { public static final String FMT_DEFAULT = "yyyy-MM-dd HH:mm:ss"; private static final Map<String, SimpleDateFormat> MAP = new HashMap<String, SimpleDateFormat>(6); public static String nowDT() { return formatDT(FMT_DEFAULT); }/*from w ww.j av a2s . c om*/ public static String formatDT(String fmt) { return formatDT(fmt, new Date()); } public static String formatDT(String fmt, Date date) { return getFmt(fmt).format(date); } public static DateFormat getFmt(String fmt) { return MAP.get(fmt); } }