Java Time Now getNowWithLocal(boolean ifdatetime)

Here you can find the source of getNowWithLocal(boolean ifdatetime)

Description

get current date by local pattern

License

Apache License

Parameter

Parameter Description
ifdatetime a parameter

Return

String

Declaration

public static String getNowWithLocal(boolean ifdatetime) 

Method Source Code

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

public class Main {
    /**//from  w ww .j  a  v a  2 s . c om
     * get current date by local pattern
     * 
     * @param ifdatetime
     * @return String
     */
    public static String getNowWithLocal(boolean ifdatetime) {
        java.util.Date dd = new java.util.Date();
        if (ifdatetime) {
            return java.text.DateFormat.getDateTimeInstance(java.text.DateFormat.LONG, java.text.DateFormat.LONG)
                    .format(dd);
        } else {
            return java.text.DateFormat.getDateInstance(java.text.DateFormat.LONG).format(dd);
        }
    }
}

Related

  1. getNowTime()
  2. getNowTime()
  3. getNowTime(String format)
  4. getNowTime(String format, Locale loc)
  5. getNowTime(String formatStr)
  6. getNowYearMonth()
  7. getNowYMD()
  8. getSpecifiedDateTime_235959(Date curDate)
  9. getStrCurrentStrTime()