Hi buddies My target is to compare two dates, which are in String format. The Possible String formats are "10-OCT-2002" and "10-10-2002". Please guide me which class should i use, in order to get the my string converted to date, AND Which functions should i use, So that i can compare (less than, greater than comparision) two dates (converted above with the help of some xyz class) Please guide me at your earliest....
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
How about SimpleDateFormat formatter = new SimpleDateFormat ("[yy.MM.dd hh:mm:ss:SSS zz]"); Date currentTime_1 = new Date(); String date = formatter.format(currentTime_1); Have a look at the SimpleDateFormat on how to format the date time differently.
Thanks, Jonathan and Ilja for the effort taken by you to help me out, But the information provided by you is not helping me completely, Can you please provide me the code for the task, which i need to acheive. 1)I have two dates : "10-JAN-1920" and "10-APR-1950", 2) Please provide me the code to convert the above dates to String and After conversion, compare the above two dates which can tell me that the first date is greater than the second one..... I hope, that you understand the problem i am facing...... I want both the above things to be accomplished
Waiting for a solution... [ August 28, 2002: Message edited by: Manish Sachdev ] [ August 28, 2002: Message edited by: Manish Sachdev ]