I have a application that uses a formatted text field for users to input dates, and that part is a must have so I cannot change it.
I want to be able to check if the date is a valid date (ie no 2020-02-39) and if it is, pass it on to the next part of my application as a java.util.Date object, and if not raise an exception.
I have this
from java.text import SimpleDateFormat ... inputFormat = SimpleDateFormat('yyyy-MM-dd') dt = data['date'] dateOut = SimpleDateFormat(inputFormat, dt)
But this does not seem to be working as expected. The formatted input box is yyyy-MM-dd and will have two values for the day always. Any insight as to whats going wrong?