[java] java create date object using a value string

Try this :-

try{
        String valuee="25/04/2013";
        Date currentDate =new SimpleDateFormat("dd/MM/yyyy").parse(valuee);
        System.out.println("Date is ::"+currentDate);
        }catch(Exception e){
            System.out.println("Error::"+e);
            e.printStackTrace();
        }

Output:-

   Date is ::Thu Apr 25 00:00:00 GMT+05:30 2013

Your value should be proper format.

In your question also you have asked for this below :-

   Date currentDate = new Date(value);

This style of date constructor is already deprecated.So, its no more use.Being we know that Date has 6 constructor.Read more