Here you can find the source of getCurrentTime()
public static String getCurrentTime()
//package com.java2s; //License from project: Open Source License import java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Main { private static Date _currentDate; private static DateFormat _dateFormat; public static String getCurrentTime() { if (_currentDate != null) { _currentDate.setTime(System.currentTimeMillis()); } else {//from w ww. j ava 2 s. com _currentDate = new Date(); } if (_dateFormat == null) { _dateFormat = new SimpleDateFormat("MMM-dd-yyyy__hh-mm-ssa"); } return _dateFormat.format(_currentDate); } }