How to parse toString date value to Date object

I have some issue with toString date value parse to Date object. here is my solution for that.

     try {
 Date cutterntTime = new Date();
 String dateStringValue = cutterntTime.toString();
 //String dateStringValue = Thu May 05 11:26:49 IST 2011;
 DateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
 Date date = (Date)formatter.parse(dateStringValue);

 System.out.println("Date Value is : " + date);
     } catch (ParseException e){
 System.out.println("Exception :"+e);


Unknown said…
Casino Game For Sale by Hoyle - Filmfile Europe
› casino-games › casino-games › casino-games › casino-games Casino Game for sale by Hoyle on Filmfile Europe. Free shipping for novcasino most countries, no download required. Check the deals we have.

Popular posts from this blog

Yield Price Sri Lanka - Android Application

Building a RESTFul Service using Spring Boot

XSLT - Modify Date and DateTime value