Java Date Now getCurrentDay()

Here you can find the source of getCurrentDay()

Description

get Current Day

License

Apache License

Declaration

public static String getCurrentDay() 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getCurrentDay() {
        return getDefaultDateFormat().format(java.util.Calendar.getInstance().getTime());
    }/*from   www . j a  v a2 s  . c o m*/

    public static String format(Date date, String formatPattern) {
        if (date == null) {
            return "";
        } else {
            return new SimpleDateFormat(formatPattern).format(date);
        }
    }

    public static SimpleDateFormat getDefaultDateFormat() {
        return new SimpleDateFormat("yyyyMMdd");
    }
}

Related

  1. getCurrentDateToString(String pattern)
  2. getCurrentDateWithDot()
  3. getCurrentDay()
  4. getCurrentDay()
  5. getCurrentDay()
  6. getCurrentDay()
  7. getCurrentDay()
  8. getCurrentDay(int model)
  9. getCurrentDay(String pattern)