aspose file tools*
The moose likes Java in General and the fly likes How do i convert a Date object into a Timestamp object ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How do i convert a Date object into a Timestamp object ?" Watch "How do i convert a Date object into a Timestamp object ?" New topic
Author

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

Rasmeet Devji
Greenhorn

Joined: Dec 08, 2000
Posts: 17
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

Joined: Sep 29, 2000
Posts: 8521
I think you accidently posted this question twice. See the other thread here:
http://www.javaranch.com/ubb/Forum1/HTML/000921.html


"JavaRanch, where the deer and the Certified play" - David O'Meara
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
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
 
subject: How do i convert a Date object into a Timestamp object ?
 
Similar Threads
How to convert timeStamp into corresponding date.
How do i convert a Date object into a Timestamp object ?
Thread or not
TimeStamp.toString() does not work as expected
How do i convert a Date object into a TimeStamp object