on 2006 Feb 21 2:42 PM
Hi,
I have a Date field in my webdynpro application, I need to to read this from my current context and convert the same to a Calendar field and pass it to my model.
Calendar date = CalendarConverter.parseDate(req_date.toString());
The above code gives me a null pointer exception.
Can anyone suggest me the right way of handling this Date object to Calendar object conversion?
Ashwini.
Request clarification before answering.
Calendar calendar = Calendar.getInstance();
/* Option 1 */
calendar.setTime( dt );
/*
dt is java.util.Date/java.sql.Date/java.sql.Timestamp instance
*/
/* Option 2 */
calendar.setTimeInMillis( System.currentTimeMillis() );
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
33 | |
21 | |
16 | |
8 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.