Here you can find the source of getCurrentDateTime()
private static String getCurrentDateTime()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static String getCurrentDateTime() { Calendar currentDate = Calendar.getInstance(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MMM/dd HH:mm:ss"); String dateNow = formatter.format(currentDate.getTime()); return dateNow; }//w w w . j a v a2 s . c o m }