0

How to convert String date into Date obj

DateFormat df = new SimpleDateFormat("dd/MM/yyyy");

try
{
Date today = df.parse("10/12/2009"); //converts String object into Date Object
System.out.println("Today = " + df.format(today)); //formats the Date object accourding to the format mentioned above
} catch (ParseException e)
{
e.printStackTrace();
}

|

0 Comments

Copyright © 2009 So That I Can Remember All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.