Here you can find the source of nowDT()
public static String nowDT()
//package com.java2s; //License from project: LGPL import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String FMT_DEFAULT = "yyyy-MM-dd HH:mm:ss"; public static String nowDT() { return formatDT(FMT_DEFAULT); }/*from w w w. j ava2 s . c om*/ public static String formatDT(String fmt) { return formatDT(fmt, new Date()); } public static String formatDT(String fmt, Date date) { return new SimpleDateFormat(fmt).format(date); } }