Here you can find the source of getDate()
public static final String getDate()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static final String getDate() { Calendar cal = Calendar.getInstance(); java.text.SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); String cdate = sdf.format(cal.getTime()); return cdate; }/* w w w . j av a2 s . c o m*/ }