Here you can find the source of getCurrentDate()
public static String getCurrentDate()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//from www . j a v a 2s. com * Returns the current date in the format that matches {@link this#getDateFormat()} * * @return The current date in the format that matches {@link this#getDateFormat()} */ public static String getCurrentDate() { return new SimpleDateFormat(getDateFormat()).format(new Date(System.currentTimeMillis())); } /** * Returns the date format that should be used for dates * * @return The date format that should be used for dates */ public static String getDateFormat() { return "yyyy-MM-dd HH:mm:ss.S"; } }