Java Date Now getCurrentDate(String pattern)

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

Description

get Current Date

License

Open Source License

Parameter

Parameter Description
pattern a parameter

Declaration

public static String getCurrentDate(String pattern) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getCurrentDate(String pattern) {

        String result;/* www .  j ava  2 s  . com*/

        SimpleDateFormat formatter = new SimpleDateFormat(pattern);

        result = formatter.format(new Date());

        return result;

    }
}

Related

  1. getCurrentDate(String format)
  2. getCurrentDate(String format)
  3. getCurrentDate(String format)
  4. getCurrentDate(String formatStr)
  5. getCurrentDate(String pattern)
  6. getCurrentDate(String pattern)
  7. getCurrentDate(String pattern, Locale locale)
  8. getCurrentDate2(String format)
  9. getCurrentDate_String()