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 Pierre Delisle <pi...@sun.com> on 2003/03/03 18:02:41 UTC

Re: Date value "now"


David Goodenough wrote:
> In an early version of JSTL (one prior to proper release) I seem to recall
> that leaving the value out of a fmt:formatDate tag defaulted to using the
> value of "now" as the time/date to format.  This seems to have vanished
> from the released version.  Firstly why the change, and secondly what is
> the approved method, preferably without resorting to Java, of formatting
> the current time.  The best I have found is to jsp:useBean with class
> java.util.Date, which will default to now, and format that.
> 
> Thanks in advance
> 
> David

Can't remember exactly why it was dropped, but I'm sure there was
a good reason :-). We had then added the following text
in the spec (Section 9.9) to make sure questions like yours would
be answered in the spec itself:

   In order to format the current date and time, a <jsp:useBean>
   action may be used as follows:

   <jsp:useBean id="now" class="java.util.Date" />
   <fmt:formatDate value="${now}" />


     -- Pierre


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




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