Java Format - Java DateFormat.isLenient()








Syntax

DateFormat.isLenient() has the following syntax.

public boolean isLenient()

Example

In the following code shows how to use DateFormat.isLenient() method.

/*from  w w w  .j av a  2 s  . c om*/
import java.text.DateFormat;
import java.util.Date;

public class Main {
  public static void main(String[] argv) throws Exception {
    DateFormat dateFormat = DateFormat.getDateTimeInstance();
    
    
    String s = dateFormat.format(new Date());
    System.out.println(dateFormat.isLenient());

  }
}

The code above generates the following result.