File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do i convert a Date object into a Timestamp object ?

 
Rasmeet Devji
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I got to store the current date and time in a Timestamp variable, i could retrieve the current date and time using
Calendar cal = Calendar.getInstance(TimeZone.getDefault());
cal.getTime();
but the method of getTime() returns a date object where as i need a Timestamp object, now how do i convert a date object into a Timestamp object??
Please try and reply on this one!
Regards!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you accidently posted this question twice. See the other thread here:
http://www.javaranch.com/ubb/Forum1/HTML/000921.html
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Cindy Glass:
I think you accidently posted this question twice. See the other thread [...]

It might not be an accident. The question was posted in the JDBC forum as well.
- Peter
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic