You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Ramkumar Krishnan <ra...@gmail.com> on 2005/06/03 18:33:58 UTC

fmt:parseDate

Hi All,
  I want to parse the date and time separately from the string
"2005-05-31 18:23:07.0".
I tried using <fmt:parseDate and i am getting "unparseble date" exception.
Is there any other way to parse date and time separately from the above string?


thanks,
-- 
Ramkumar Yadav K,

<a href="http://www.spreadfirefox.com/?q=affiliates&amp;id=0&amp;t=65"><img
border="0" alt="Get Firefox!" title="Get Firefox!"
src="http://sfx-images.mozilla.org/affiliates/Buttons/110x32/safer.gif"/></a>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: fmt:parseDate

Posted by Ramkumar Krishnan <ra...@gmail.com>.
Hi Rahul,
     I have written the code like

<fmt:parseDate pattern="yyyy-MM-dd HH:mm:ss.S"
var="parsedDateTime" parseLocale="en_US">
2005-06-10 19:11:10.0
</fmt:parseDate><td nowrap><fmt:formatDate value="${parsedDateTime}"
pattern="MM/dd/yyyy"/>&nbsp;</td>
                 <td nowrap><fmt:formatDate value="${parsedDateTime}"
pattern="hh:mm:ss"/>&nbsp;</td>

I want to print only the date (06/10/2005) in the first TD and
19:11:10 in the second TD.

but both are printing the full date like
"Fri Jun 10 19:11:10 GMT+05:30 2005"

Any clues how to present date and time separately?

thanks,
Ramkumar



On 6/4/05, Rahul P Akolkar <ak...@us.ibm.com> wrote:
> Ramkumar Krishnan <ra...@gmail.com> wrote on 06/03/2005 12:33:58
> PM:
> 
> > Hi All,
> >   I want to parse the date and time separately from the string
> > "2005-05-31 18:23:07.0".
> <snip/>
> 
> Not sure what parse separately means. You parse once, and maybe, format
> twice (to present date and time separately).
> 
> > I tried using <fmt:parseDate and i am getting "unparseble date"
> exception.
> > Is there any other way to parse date and time separately from the
> > above string?
> <snap/>
> 
> Its parseable.
> <fmt:parseDate pattern="yyyy-MM-dd HH:mm:ss.S"
> var="parsedDateTime">2005-05-31 18:23:07.0</fmt:parseDate>
> 
> -Rahul
> 
> 


-- 
Ramkumar Yadav K,

<a href="http://www.spreadfirefox.com/?q=affiliates&amp;id=0&amp;t=65"><img
border="0" alt="Get Firefox!" title="Get Firefox!"
src="http://sfx-images.mozilla.org/affiliates/Buttons/110x32/safer.gif"/></a>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: fmt:parseDate

Posted by Rahul P Akolkar <ak...@us.ibm.com>.
Ramkumar Krishnan <ra...@gmail.com> wrote on 06/03/2005 12:33:58 
PM:

> Hi All,
>   I want to parse the date and time separately from the string
> "2005-05-31 18:23:07.0".
<snip/>

Not sure what parse separately means. You parse once, and maybe, format 
twice (to present date and time separately).

> I tried using <fmt:parseDate and i am getting "unparseble date" 
exception.
> Is there any other way to parse date and time separately from the 
> above string?
<snap/>

Its parseable.
<fmt:parseDate pattern="yyyy-MM-dd HH:mm:ss.S" 
var="parsedDateTime">2005-05-31 18:23:07.0</fmt:parseDate>

-Rahul