| Author |
Getting the correct date
|
Brad Lahr
Greenhorn
Joined: May 09, 2003
Posts: 9
|
|
Could someone tell me what I am doing wrong? This seems so simple. > java -version java version "1.4.1_01" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01) Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode) > java myDate Exception in thread "main" java.lang.IllegalArgumentException: Cannot format given Object as a Date at java.text.DateFormat.format(DateFormat.java:279) at java.text.Format.format(Format.java:133) at myDate.main(myDate.java:15) > cat myDate.java Thanks in advance for any help.
|
 |
Barry Gaunt
Ranch Hand
Joined: Aug 03, 2002
Posts: 7729
|
|
|
Works OK for me on 1.4.2 Beta
|
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
|
 |
Peter Tersteeg
Greenhorn
Joined: May 12, 2003
Posts: 3
|
|
I've built and run this using java 1.4.1_01-b01 with no problems. Try running with: >java -classpath "<the directory path here>" myDate [ May 14, 2003: Message edited by: Peter Tersteeg ]
|
 |
Donald R. Cossitt
buckaroo
Ranch Hand
Joined: Jan 31, 2003
Posts: 401
|
|
Compiles and runs really well on SDK1.4.1_02 Output == 14 May 2003.
|
doco
|
 |
 |
|
|
subject: Getting the correct date
|
|
|