This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Can't get a date Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Can Watch "Can New topic
Author

Can't get a date

Al Wells
Ranch Hand

Joined: Apr 18, 2005
Posts: 87
Luckily I am married...

I pretty much copied the following from the Java tutorial. I have tried
all kinds of imports to no avail. Why will the following not compile?



The compiler gives me the following:

C:\SMLocal\SMLogic>javac DateReporter.java
DateReporter.java:7: cannot find symbol
symbol : class DateFormat
location: class DateReporter
DateFormat dateFormatter;
^
DateReporter.java:13: cannot find symbol
symbol : variable DateFormat
location: class DateReporter
dateFormatter = DateFormat.getDateInstance(DateFormat.SHORT, currentLocale);
^
DateReporter.java:13: cannot find symbol
symbol : variable currentLocale
location: class DateReporter
dateFormatter = DateFormat.getDateInstance(DateFormat.SHORT, currentLocale);
^
DateReporter.java:13: cannot find symbol
symbol : variable DateFormat
location: class DateReporter
dateFormatter = DateFormat.getDateInstance(DateFormat.SHORT, currentLocale);
^
4 errors
Al Wells
Ranch Hand

Joined: Apr 18, 2005
Posts: 87
Finally figured it out. Why does that happen after hours of thinking but
only after I post... In any event, here is what I did:



Now to test it.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Can't get a date
 
Similar Threads
Date difference
DateFormat Class Problem
get the Yesterday's date ??
DateFormat class
how can i reformat a Date object