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
Post a Comment