title: Formatting and parsing Joda-Time based date and time objects in JSP
body: <p>I'm using <a href="http://sourceforge.net/projects/joda-time/files/joda-time-jsptags/1.1.1/" rel="nofollow">joda-time-jsptags-1.1.1</a> to format and parse <a href="http://www.joda.org/joda-time/" rel="nofollow">Joda-Time</a> based date and time objects on JSP pages with the following taglib.</p>
  
  <pre><code>&lt;%@taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %&gt;
  </code></pre>
  
  <p>I have dates in Oracle database which are stored using the standard UTC format. </p>
  
  <p>Using the following JSTL tags,</p>
  
  <pre><code>&lt;c:set var="startDate" value="${row.discountStartDate}"/&gt;
  &lt;c:set var="endDate" value="${row.discountEndDate}"/&gt;
  </code></pre>
  
  <p>these two dates are displayed in the following format respectively.</p>
  
  <pre><code>2013-02-16T22:31:59.000+05:30 
  2013-02-28T22:32:03.000+05:30   
  </code></pre>
  
  <p>I need to display these dates in a specific format using a specific time zone. I'm trying to parse these dates as follows.</p>
  
  <pre><code>&lt;joda:parseDateTime var="startDate"
                      pattern="dd-MMM-yyyy HH:mm:ss"
                      value="${row.discountStartDate}"
                      dateTimeZone="Asia/Kolkata"/&gt;
  
  &lt;joda:parseDateTime var="endDate"
                      pattern="dd-MMM-yyyy HH:mm:ss"
                      value="${row.discountStartDate}"
                      dateTimeZone="Asia/Kolkata"/&gt;
  </code></pre>
  
  <p>I expect these dates to be parsed in the given format and zone. I'm however, getting the following exception.</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Invalid format:
    "2013-02-16T22:31:59.000+05:30" is malformed at
    "13-02-16T22:31:59.000+05:30"</p>
  </blockquote>
  
  <p>How to parse these dates </p>