Java Date Now getCurrentTimeNoHour()

Here you can find the source of getCurrentTimeNoHour()

Description

get Current Time No Hour

License

Apache License

Declaration

public static String getCurrentTimeNoHour() 

Method Source Code


//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);
    }
}

Related

  1. getCurrentTimeForUseInAFileName()
  2. getCurrentTimeInMySqlTime()
  3. getCurrentTimeInMySqlTime()
  4. getCurrentTimeInString(SimpleDateFormat dateFormat)
  5. getCurrentTimeInString(String format)
  6. getCurrentTimeNumber()
  7. getCurrentTimeOfDay()
  8. getCurrentTimeStamp()
  9. getCurrentTimeStamp()