Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { /** * @Title: getCurrentDate * @Description: TODO * @return String of current date */ public static String getCurrentDate() { Date now = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.getDefault()); return dateFormat.format(now); } }