Skip to content
Advertisement

java.text.ParseException: Unparseable date: convert mm/dd/yyyy string to a date

when i convert my string object in mm/dd/yyyy format to Date it gives me

JavaScript

i am trying to do it like this :

JavaScript

Advertisement

Answer

There are several potential problems here:

  • You’re not specifying a format
  • You’re not specifying a locale
  • You’re not specifying a time zone
  • You’re trying to cast the return value (which will be a java.util.Date reference) to a java.sql.Date – that would fail

You want something like:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement