Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; public class Main { /** * getCurrentDate: return current time with year-month-day format * @return */ public static String getCurrentDate() { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); return dateFormat.format(new java.util.Date()); } }