Here you can find the source of getNowWithLocal(boolean ifdatetime)
Parameter | Description |
---|---|
ifdatetime | a parameter |
public static String getNowWithLocal(boolean ifdatetime)
//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); } } }