Here you can find the source of getCurrentDateYearMonthDateHourMinuteSecond()
public static String getCurrentDateYearMonthDateHourMinuteSecond()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getCurrentDateYearMonthDateHourMinuteSecond() { Calendar calendar = Calendar.getInstance(); SimpleDateFormat toDateFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); return toDateFormat.format(calendar.getTime()); }// w w w . jav a 2s .co m }