Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DateFormat.isLenient()

 
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic