Here you can find the source of currentTimedDate()
public static String currentTimedDate()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; /**//from w w w. j a va 2 s .co m * Get the current date and time in sting form * * @return the current date and time as a string */ public static String currentTimedDate() { Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); return sdf.format(cal.getTime()); } }