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;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {

    public static String getCurrentDate() {

        String format = "yyyy-MM-dd";

        return formatDate(format);
    }//from   w w  w  .  j  a  v a 2 s . c om

    private static String formatDate(String format) {

        Date date = new Date();

        return formatDate(date, format);
    }

    private static String formatDate(Date date, String format) {

        String str = "";
        SimpleDateFormat dateformat = new SimpleDateFormat(format);
        str = dateformat.format(date);

        return str;
    }
}

Related

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