What is the error message? It could be that if you did not import
java.util.* and java.text.*, then it can't find the classes listed after the
'new'.  Try it like this :
<%
java.util.GregorianCalendar cal    = new java.util.GregorianCalendar();
java.text.SimpleDateFormat  format = java.text.new
SimpleDateFormat("mm-dd-yy");
String s = format(cal.getTime());
%>
<html><body>

<%
out.println(s);

%>
</body></html>
-----Original Message-----
From: Carlos [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 10:11 AM
To: [EMAIL PROTECTED]
Subject: Re: date


in a jsp page i have put the next but doesn't run: Why?
<%
java.util.GregorianCalendar cal    = new GregorianCalendar();
java.text.SimpleDateFormat  format = new SimpleDateFormat("mm-dd-yy");
String s = format(cal.getTime());
%>
<html><body>

<%
out.println(s);

%>
</body></html>


thanks
Carlos

----- Original Message -----
From: "Michael Wentzel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 02, 2001 2:54 PM
Subject: RE: date


> > in jsp how i get the date for print in web in the format XX-XX-XX?
>
> Works just like any other java class:
>
> java.util.GregorianCalendar cal    = new GregorianCalendar();
> java.text.SimpleDateFormat  format = new SimpleDateFormat("mm-dd-yy");
> String s = format(cal.getTime());
>
> ---
> Michael Wentzel
> Software Developer
> <A HREF="http://www.aswethink.com">Software As We Think</A>
> <A HREF="mailto:[EMAIL PROTECTED]">Michael Wentzel</A>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to