Java Date Now currentDate()

Here you can find the source of currentDate()

Description

Get todays date in string form WITHOUT a time-stamp

License

Open Source License

Return

todays date as a string

Declaration

public static String currentDate() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    private static final String DATE_FORMAT_DAY = "yyyy-MM-dd";

    /**/*w w  w  . ja  v  a  2  s .c  o m*/
     * Get todays date in string form WITHOUT a time-stamp
     * 
     * @return todays date as a string
     */
    public static String currentDate() {
        Calendar cal = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_DAY);
        return sdf.format(cal.getTime());
    }
}

Related

  1. currentAfterDay(Date date)
  2. currentDate()
  3. currentDate()
  4. currentDate()
  5. currentDate()
  6. currentDate()
  7. currentDate()
  8. currentDate()