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