In a Jsp I’ve got a input date String formatting as “Aug-6-2009”,how to change that to “2009-08-06” so that Mysql can read.
Maybe i need regex?
That may seem to be a easy question,but bear with me.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use a
SimpleDateFormatobject’s.parse()and.format()methods to get a string in the format you need.https://docs.oracle.com/javase/1.5.0/docs/api/java/text/SimpleDateFormat.html