Java Date Now getCurrentDate()

Here you can find the source of getCurrentDate()

Description

get Current Date

License

Open Source License

Declaration

public static String getCurrentDate() 

Method Source Code


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

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

public class Main {
    public static String getCurrentDate() {
        return getCurrentDateTime().substring(0, 11);
    }//from   w  w  w.ja  v a2 s.co  m

    public static String getCurrentDateTime() {

        DateFormat dateFormat = new SimpleDateFormat("_yyyy-MM-dd_HH-mm-ss");
        Calendar cal = Calendar.getInstance();
        String time = "" + dateFormat.format(cal.getTime());
        return time;
    }
}

Related

  1. getCurrentDate()
  2. getCurrentDate()
  3. getCurrentDate()
  4. getCurrentDate()
  5. getCurrentDate()
  6. getCurrentDate()
  7. getCurrentDate()
  8. getCurrentDate()
  9. getCurrentDate()