Srinu.Reddy wrote:
Hi All,

I am new to JSp programming.My problem is I am having a STRING which has a
date in it as (2002-10-31 20:45:00 ) but I want to display that in the
following format : (31-OCT-2002 08:45:00 PM). How can I do that?
You can use the JSTL formatting actions:

  <!-- inDate is a variable with 2002-10-31 20:45:00 -->
  <fmt:parseDate value="${inDate}" pattern="yyyy-MM-dd HH:mm:ss"
    var="myDate" />
  <!-- Display as 31-OCT-2002 08:45:00 PM -->
  <fmt:formatDate value="${myDate}" pattern="dd-MMM-yyyy hh:mm:ss a" />

For more about the JSP Standard Tag Library (JSTL) spec, see

  <http://java.sun.com/products/jsp/jstl/>

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
JavaServer Pages        http://TheJSPBook.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com

Reply via email to