Java Date Now getCurrentDate()

Here you can find the source of getCurrentDate()

Description

get Current Date

License

Open Source License

Declaration

public static Date getCurrentDate() 

Method Source Code


//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static Date getCurrentDate() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String date = format.format(new Date());
        try {/*  ww w  .  j ava 2 s .  c o  m*/
            return format.parse(date);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        return null;
    }
}

Related

  1. getCurrentDataInFormat(String pattern)
  2. getCurrentDataTimePrettyFilesystem()
  3. getCurrentDate()
  4. getCurrentDate()
  5. getCurrentDate()
  6. getCurrentDate()
  7. getCurrentDate()
  8. getCurrentDate()
  9. getCurrentDate()