• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Timestamp part of java? Import perhaps..

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found Timestamp in java.sql.* package.
 
Michael Baca
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could check out the Javaranch Dates FAQ.
 
yeah, but ... what would PIE do? Especially concerning this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic