Here you can find the source of getNow(final String format)
static public String getNow(final String format)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { static public String getNow() { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return sdf.format(new Date()); }//from w ww . j a v a 2 s . com static public String getNow(final String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(new Date()); } }