Multiple Date Parsers

Hy all

I getting multiple dates from the net and each has a different format.

In Perl is ease to parse this dates, in reality, many different packages do it.

But I'm needing to do this in Java, I have dates like:

Sun, 19 May 2002 15:21:36 GMT
2007-10-07T14:43:00Z
2007/02/05
200603251524

And many others. so isn't easy to get a simple format to all of them. Is there a intelligent package in Java that get any of this dates and returns me the number of seconds since epoc, without the need of suppling a date from my side?

Thanks
Oleber
LVL 10
oleberAsked:
Who is Participating?
 
CEHJCommented:
Nothing other than trying multiple DateFormat. It would be better to constrain input
0
 
oleberAuthor Commented:
I'd like to have always the some format, but I'm collecting data from different sources that we don't control. In this XML exists a field that is a data, the only problem is that different sources fill the date in different formats.

Clearly, I'm trying to avoid this solution, it isn't generic enough.

So the question continues: Is there a Generic Package (don't need to be a from SUN) that parses multiple format dates?

+- the same as Date::Manip or Date::Calc, ... from Perl.

Thanks
Oleber
0
 
CEHJCommented:
Any package would simply have to try different date formats. You would be better off tailor making one for your own variations
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.