Java Date Now getCurrentDate(String format)

Here you can find the source of getCurrentDate(String format)

Description

get Current Date

License

Apache License

Declaration

public static String getCurrentDate(String format) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final String Format_Date = "yyyy-MM-dd";

    public static String getCurrentDate() {
        return new SimpleDateFormat(Format_Date).format(new Date());
    }//from  w  ww. ja v  a 2 s . c o m

    public static String getCurrentDate(String format) {
        SimpleDateFormat t = new SimpleDateFormat(format);
        return t.format(new Date());
    }
}

Related

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