• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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.
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic