Try the following....

<CODE>
        if( logFile.exists() )
        {
        Date d = new Date( logFile.lastModified() );
        DateFormat df = getDateInstance(DateFormat.LONG);
        logFileDate = df.format( d );
        }
</CODE>

The only difference is that you must use DateFormat.LONG rather than
Locale.LONG.
If you need a format appropriate for different Locales, you can pass in the
locale
of interest by calling getDateInstance(DateFormat.LONG, currentLocale).

-AMT


> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Rick Reumann
> Sent: Thursday, April 20, 2000 8:20 AM
> To: [EMAIL PROTECTED]
> Subject: date/file last modified question
>
>
> The following code works fine in my page to convert the last
> modified date into a mm-dd-yyyy format.
>
> <%@ import="java.text.*, java.io.*, java.util.*;" %>
> <%
> String logFileDate = null;
> File logFile = new File(
> "/app/webdocroot/insidectm/logs/coxdirect/2000/cdcor2000report.ht
> m" );
> if( logFile.exists() )
> {
>         Date d = new Date( logFile.lastModified() );
>         DateFormat df = new SimpleDateFormat( "MM-dd-yyyy" );
>         logFileDate = df.format( d );
>
> }
> %>
>
> What I want, though, is to be able to generate the long date display
> (ie April 20, 2000).  I tried...
>
> if( logFile.exists() )
> {
>         Date d = new Date( logFile.lastModified() );
>         DateFormat df = getDateInstance(Locale.LONG);
>         logFileDate = df.format( d );
>   }
> %>
>
> but I end up with the error "No variable LONG defined in class
> java.util.Locale. DateFormat df = getDateInstance(Locale.LONG);
> "
> I'd really appreciate any help here. thanks lots.
> Rick
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

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

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to