Hi there.
I'm retrieving a string from a webform and processing it in a servlet. Testing has revealed a rather odd effect; if a supposedly invalid date such as "01/14/2005" is input the code accepts this as 01 Feb 2006. Equally "01/17/2005" is accepted as 01 May 2006.
The java seems to be just adding the any extra months after 12 into subsequent years. This is not going to pass testing!
Here's the code:
Output of this is as above.Code:java.util.Date datDate = datJava.parse(request.getParameter("donordate")); this.strDonDate = datSyb.format(datDate); System.out.println(strDonDate);
Anyone seen this effect before? And know how to get around it?
Thanks, DaveMere


Reply With Quote
Or have I made a mistake somewhere?



Bookmarks