| Author |
Date Format Issue
|
Ragupathirajan Venkatesan
Ranch Hand
Joined: Aug 18, 2010
Posts: 62
|
|
Dear All,
I am having the string date value and I want to convert that as java date value by using the SimpleDateFormate. But it is not highlighting the wrong date. for example.
above code is producing the output like Date: Thu Dec 13 00:00:00 IST 2012. I want to identify the incorrect format relevent to dd/MM/yyyy. Please suggest. Thanks in advance.
|
 |
Ravishanker kumar
Ranch Hand
Joined: Jul 20, 2006
Posts: 53
|
|
You can use regular expression or put validation separately for days, month and year.
~Ravi
|
 |
Ganesh Shirsat
Ranch Hand
Joined: Jan 10, 2010
Posts: 30
|
|
Hi,
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32694
|
|
13/24/2011 is being parsed "leniently", so December + 12 months is December next year.
Have a look through all the classes you are using and see whether they have a setLenient(false) method. See whether that would help.
|
 |
Ragupathirajan Venkatesan
Ranch Hand
Joined: Aug 18, 2010
Posts: 62
|
|
|
It works.Thanks a lot.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32694
|
|
Well done What works? setLenient{false} or something different?
|
 |
Ragupathirajan Venkatesan
Ranch Hand
Joined: Aug 18, 2010
Posts: 62
|
|
Sorry for the delayed reply
code given by Ganesh works for me. Thanks again for Ganesh.
|
 |
 |
|
|
subject: Date Format Issue
|
|
|