| Author |
Convert a Timestamp to Calander Object
|
Rahim Nathwani
Greenhorn
Joined: Sep 19, 2005
Posts: 19
|
|
Heyy All I have a java.sql.Timestamp and I need to convert it to a java.util.Calendar object. Any ideas? Thanks
|
 |
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
|
|
|
If you look at the API, there is a method in TimeStamp that will convert it to a long, and a method in Date which will convert a long to a Date. Then there is a method in Calendar that will let you use the Date object.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
However since a Timestamp already is a Date, you can skip the first part.
|
 |
Rahim Nathwani
Greenhorn
Joined: Sep 19, 2005
Posts: 19
|
|
Thanks Worked!!
|
 |
 |
|
|
subject: Convert a Timestamp to Calander Object
|
|
|