Java Date Now getCurrentDate(Date date)

Here you can find the source of getCurrentDate(Date date)

Description

get Current Date

License

Open Source License

Declaration

public static Date getCurrentDate(Date date) 

Method Source Code


//package com.java2s;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static Date getCurrentDate(Date date) {
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        try {//from  w  w w  .  java2s . c  om
            return df.parse(df.format(date));
        } catch (ParseException e) {
            return date;
        }
    }
}

Related

  1. getCurrentDate()
  2. getCurrentDate()
  3. getCurrentDate()
  4. getCurrentDate()
  5. getCurrentDate(boolean WithDelimeter)
  6. getCurrentDate(final String form)
  7. getCurrentDate(final String FORMAT)
  8. getCurrentDate(String format)
  9. getCurrentDate(String format)