Here you can find the source of getCurrentTime()
public static String getCurrentTime()
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static final DateFormat dateFormatting = new SimpleDateFormat( "MM-dd-yyyy_HH:mm:ss"); private static final Calendar calendar = Calendar.getInstance(); public static String getCurrentTime() { return dateFormatting.format(calendar.getTime()); }// www .jav a 2s.co m }