Java Date Now getCurrentDate()

Here you can find the source of getCurrentDate()

Description

get Current Date

License

Open Source License

Declaration

public static final Date getCurrentDate() 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final String dateFormat = "yyyy-MM-dd HH:mm:ss";

    public static final Date getCurrentDate() {
        Date currentDate = new Date();
        SimpleDateFormat df = new SimpleDateFormat(dateFormat);
        df.format(currentDate);/* w  w  w. java  2s. c  o  m*/
        currentDate.getTime();
        return currentDate;
    }

    public static final Date getCurrentDate(String pattern) {
        Date currentDate = new Date();
        SimpleDateFormat df = new SimpleDateFormat(pattern);
        df.format(currentDate);
        currentDate.getTime();
        return currentDate;
    }
}

Related

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