Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
    Bookmark Topic Watch Topic
  • New Topic

Parsing dates entered in different formats  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello

I'm having a hard time parsing dates that are entered in different formats. Is there a general way to do that? I have a text field where the user can enter a date (so obviously he can enter any format) ex.

10102010
101010
10.10.2010
10.10.10
or the date can be invalid (505002 or anything else)

Is there a general approach on how to handle things like that? i found the classes simpledateformatter and dateformatter, but they can handle only one format.

any tips appreciated.

thanks
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Closing this thread. Continue the discussion there.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!