I have a field in my SQLServer DB that is of DateTime type. JDBC returns
the value as: 2000-08-09 23:24:43.810
Then I need to format this as follows: 8/14/00
I was going to use:
<%
DateFormat myFormat = new SimpleDateFormat("MM/dd/yy");
Date myTest = myFormat.parse(rs.getString("date_mod"))
%>
But the value of: rs.getString("date_mod") is apparently not a valid date
value.
Of course I could manually parse this out based upon patterns, but I would
like to know what I must do to retrieve the dateTime value as a valid date.
Anyone aware of how I might parse and/or convert this one *the right way*?
Thanks.
Neal
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets