Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DateFormat.isLenient()  RSS feed

 
Viet Jav
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain usage method isLenient() in package java.text.DateFormat; and if possible give me a code about this method.
Thanks.
Lam nguyen.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default isLenient() is true which means that if the String in the parse() method isn't exactly in the right format it will still try to get a date from it. If setLenient(false) then the string must be in exactly the format defined by the DateFormat object.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!