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