I am working on a program that asks a user for a date and they can enter any string and I want to convert it to a date. For example I might have a user that enters Aug 24th 1998, or one that enters August 24 1998, or 8-24-98. I want to be able to accept all of these inputs and have my program know it is referring to the same date. Is their a library with this functionality?

See the API docs for SimpleDateFormat and attempt to define as many formats as possible and attempt to parse them with leniency off. Not an easy task, but I don't know of any API that already does it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.