Hi There ,
Try the following code:
import java.util.*;
import java.text.DateFormat;
class Test {
public static void main ( String args[]) {
Date theDate = new Date();
DateFormat theDateFormat = DateFormat.getDateTimeInstance
(DateFormat.FULL,
DateFormat.FULL,Locale.getDefault());
String dateOut = theDateFormat.format(theDate);
System.out.println(dateOut);
}
}
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Laran
> Coates
> Sent: Tuesday, July 25, 2000 11:17 AM
> To: [EMAIL PROTECTED]
> Subject: Identifier expected error
>
>
> What does an identifier expected error usually mean?
> My code is below. It looks like it should work but I get the error below
> the code when I run it.
>
> <snippet>
> import java.util.Calendar;
> import java.text.DateFormat;
>
> public class CzgCalendar {
>
> Date theDate = new Date();
> DateFormat theDateFormat =
> DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL,
> currentLocale);
> String dateOut = theDateFormat.format(theDate);
>
> System.out.println(dateOut);
>
> }
> </snippet>
>
> <error>
> CzgCalendar.java:12: Identifier expected.
> dateFormatter = DateFormat.getDateInstance(DateFormat.DEFAULT,
> ^
> 1 error
> </error>
>
> Sincerely,
> Laran Coates
> Chief Information Officer
> Cyzygy Multimedia, Inc.
> P: +1 (617) 277-1504
> F: +1 (413) 215-2801
> E: [EMAIL PROTECTED]
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html