File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Timestamp part of java? Import perhaps..

 
Michael Baca
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 724
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found Timestamp in java.sql.* package.
 
Michael Baca
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 724
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Timestamp has no constructor


I also can't find the method fillTimes()
Use java.util.Date instead of Timestamp
 
Michael Baca
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1364
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could check out the Javaranch Dates FAQ.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic