import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.Date;
public class StringToDate
{
public static void main(String[] args)
{
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
try
{
Date today = df.parse("20/12/2005");
System.out.println("Today = " + df.format(today));
} catch (ParseException e)
{
e.printStackTrace();
}
}
}
Tuesday, January 1, 2008
How do I convert String to Date object in Java
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment