Formatting date with SimpleDateFormat

Hi,I will get a string with different date format patternit may be dd:MM:yyyy or yyyy:MM:dd or dd:MM:yyyyby using SimpleDateFormat how can i convert it into a date of format MM:dd:yyyy irrespective of the input string I am getting.Any help?
[275 byte] By [sunish_josea] at [2007-11-27 9:26:58]
# 1
Read the input using one format; if it produces an error, catch it and read the input with the other format.
ChuckBinga at 2007-7-12 22:24:22 > top of Java-index,Java Essentials,Java Programming...
# 2

> Hi,

> I will get a string with different date format

> pattern

> it may be dd:MM:yyyy or yyyy:MM:dd or dd:MM:yyyy

>

> by using SimpleDateFormat how can i convert it into a

> date of format MM:dd:yyyy irrespective of the input

> string I am getting.

>

> Any help?

Which format would 01:02:2007 be in?

jbisha at 2007-7-12 22:24:22 > top of Java-index,Java Essentials,Java Programming...
# 3

> > Hi,

> > I will get a string with different date format

> > pattern

> > it may be dd:MM:yyyy or yyyy:MM:dd or dd:MM:yyyy

> >

> > by using SimpleDateFormat how can i convert it into

> a

> > date of format MM:dd:yyyy irrespective of the

> input

> > string I am getting.

> >

> > Any help?

>

> Which format would 01:02:2007 be in?

yes this is true..

sunish_josea at 2007-7-12 22:24:22 > top of Java-index,Java Essentials,Java Programming...
# 4

> > > Hi,

> > > I will get a string with different date format

> > > pattern

> > > it may be dd:MM:yyyy or yyyy:MM:dd or dd:MM:yyyy

> > >

> > > by using SimpleDateFormat how can i convert it

> into

> > a

> > > date of format MM:dd:yyyy irrespective of the

> > input

> > > string I am getting.

> > >

> > > Any help?

> >

> > Which format would 01:02:2007 be in?

>

>

> yes this is true..

Then how are you going to handle the situation of this ambiguous input?

jbisha at 2007-7-12 22:24:22 > top of Java-index,Java Essentials,Java Programming...