convert string into java.util.date format in java -


am having string this.

thu oct 07 11:31:50 ist 2010 

i want convert exact date time format store in sql.

am familiar many string date conversions following.

string datestring = "2001/03/09";  simpledateformat dateformat = new simpledateformat("yyyy/mm/dd"); date converteddate = dateformat.parse(datestring);  

but need convert string thu oct 07 11:31:50 ist 2010 date format timestamp.

can explain proper way of converting java.util.date format.?

try this:

simpledateformat dateformat = new simpledateformat("eee mmm dd hh:mm:ss z yyyy"); 

for future reference read on simpledateformat class: http://docs.oracle.com/javase/7/docs/api/java/text/simpledateformat.html


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -