Conversion of one date format to another format..
Hi all..Please help me out in this... I want to convert the following ...Fri May 25 17:49:34 2007 to 2007-05-25 17:49:34 Help me out of this ... Thanks in Advance .....
[224 byte] By [
Ragav_Msca] at [2007-11-27 5:30:03]

> Fri May 25 17:49:34 2007 to 2007-05-25 17:49:34
If what you have already is of type java.util.Date, then just use formatting:
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(yourDate)
If it's a String only, then you need to do conversion:
SimpleDateFormat from = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy");
SimpleDateFormat to = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
to.format(from.parse(yourString))
> Then where will be the result of the converted Data i can get...Both examples I gave state an expression resulting in a value of type String which, for example, can be passed to System.out.println() or whatever.