File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark ""Date" Problem" Watch ""Date" Problem" New topic
Author

"Date" Problem

Paresh Joshi
Greenhorn

Joined: Jul 19, 2007
Posts: 5
i am getting Date object from another Class's method.
now i want to add some days (integer) and wants new Date (only date part)

there are some methods in this class but most of them are Deprecated

is there any way to do this ? , or any way to convert Date object to Calendar

please help !

Thanks
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14338
    
  22

Class Calendar has a setTime() method which you can use to set the calendar to the date and time of a Date object:


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Hong Lu
Greenhorn

Joined: Aug 13, 2007
Posts: 1
see below

Calendar calendar = Calendar.getInstance();
calendar.setTime(yourDate);

you may find more useful information in API document.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: "Date" Problem