Here you can find the source of getCurrentTimeNoHour()
public static String getCurrentTimeNoHour()
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String DEFAULT_FORMAT_NOHOUR = "yyyy-MM-dd"; public static String getCurrentTimeNoHour() { return getDate(new Date(), DEFAULT_FORMAT_NOHOUR); }// ww w. j a v a 2 s. com public static String getDate(Date date, String formate) { SimpleDateFormat sf = new SimpleDateFormat(formate); return sf.format(date); } public static Date getDate(String dateStr, String formate) throws ParseException { SimpleDateFormat sf = new SimpleDateFormat(formate); return sf.parse(dateStr); } }