Java Date Now currentDate_DDMMYY()

Here you can find the source of currentDate_DDMMYY()

Description

Speaking method for easier scripting.

License

Open Source License

Return

current date in format like 24.12.13

Declaration

public static String currentDate_DDMMYY() 

Method Source Code


//package com.java2s;
import java.text.DateFormat;
import java.util.Date;

public class Main {
    /**//from w w  w  .java 2  s .  c  om
     * Speaking method for easier scripting.
     * 
     * @return current date in format like 24.12.13
     */
    public static String currentDate_DDMMYY() {
        return currentDate(DateFormat.SHORT);
    }

    /**
     * Current date as formatted string representation.
     * 
     * @param dateStyle
     *            one of DateFormat.SHORT, MEDIUM, LONG, FULL
     * @return the formatted date string.
     */
    public static String currentDate(int dateStyle) {
        DateFormat df = DateFormat.getDateInstance(dateStyle);
        return df.format(new Date());
    }
}

Related

  1. currentDate(String format)
  2. currentDate(String format, Locale locale)
  3. currentDate(String format, String locale)
  4. currentDate2String()
  5. currentDate2String()
  6. currentDateAsString()
  7. currentDatePath(String basePath)
  8. currentDateStr()
  9. currentDateStr(String format)