Link to home
Create AccountLog in
Avatar of Jagadeesh M
Jagadeesh MFlag for United States of America

asked on

Calendar Object to date...

How do i conver a calender object to date....


i.e <%

                Calendar fromTime = Calendar.getInstance();

                fromTime.set(2006, 03, 28, 9, 0, 0);
                        
                        System.out.println(fromTime);

                     Calendar toTime = Calendar.getInstance();

                toTime.set(2006, 04, 04, 0, 0, 0);%>


i'm passing fromTime and toTime to another jsp.....there i need to retrieve the objects into date-time formats

thank you.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Date d = cal.getTime();
Avatar of sciuriware
sciuriware

Use SimpleDateFormat to specify the exact parts and their format you need.

;JOOP!
ASKER CERTIFIED SOLUTION
Avatar of sciuriware
sciuriware

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
>>i'm passing fromTime and toTime

Pass the value as a Date- more efficient and extensible