| Author |
Timestamp part of java? Import perhaps..
|
Michael Baca
Greenhorn
Joined: May 27, 2004
Posts: 17
|
|
The code below is just a simple java clock from a book that I'm reading. However Timestamp gives me an error: Timestamp cannot be resolved or is not a type. Not exactly sure what I'm doing wrong, but see that there is no reference to Timestamp in my code, I would assume it is not a part of my imports. [ February 15, 2005: Message edited by: Michael Baca ]
|
 |
David Ulicny
Ranch Hand
Joined: Aug 04, 2004
Posts: 724
|
|
|
I found Timestamp in java.sql.* package.
|
SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
|
 |
Michael Baca
Greenhorn
Joined: May 27, 2004
Posts: 17
|
|
|
Yeah I found it there also, however it does not seem to work for anything not releated to database programs. Actually that just sounds dumb. It should work just fine. But when I imported it I get errors by refering to it with t.hrs, t.secs, etc. The the line containing the previous error gives me grief again.
|
 |
David Ulicny
Ranch Hand
Joined: Aug 04, 2004
Posts: 724
|
|
Timestamp has no constructor I also can't find the method fillTimes() Use java.util.Date instead of Timestamp
|
 |
Michael Baca
Greenhorn
Joined: May 27, 2004
Posts: 17
|
|
I found the timestamp code.. It was not in the book! But I found it on the books site. Seems impossible to find a decent book these days.. At least for Java. Thanks for your help. Kinda feel like an idiot though. [ February 15, 2005: Message edited by: Michael Baca ]
|
 |
Carol Enderlin
drifter
Ranch Hand
Joined: Oct 10, 2000
Posts: 1348
|
|
|
You could check out the Javaranch Dates FAQ.
|
 |
 |
|
|
subject: Timestamp part of java? Import perhaps..
|
|
|