Get your CodeRanch badge!*
The moose likes Beginning Java and the fly likes Timestamp part of java? Import perhaps.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Timestamp part of java? Import perhaps.." Watch "Timestamp part of java? Import perhaps.." New topic
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: 1364
You could check out the Javaranch Dates FAQ.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Timestamp part of java? Import perhaps..
 
Similar Threads
Getting error when running swing program
Static Methods Don't Work
Just Java 2 clock class help required (Resolved)
JWindow showing up as a white box
Question from Just Java 2