• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date Field Class and Dates

 
Danish Shaukat
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !
I am using the standard Date GUI(DateField) in my midlet. I extract the date entered by the user using getDate() method of DateField.
I want to perform some operations on the Date object, like getDay(), getMonth() etc. But i always get compiler error. It seems that CLDC does not fully support the Date class.This is really annoying. Whats the use of the standard Date GUI, if we cannot perform any operations on the extracted date. I'm using J2ME Wireless Toolkit 1.0.
Anyone else facing such problems ?
Regards
Danish
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because of the constraints of portable devices, CLDC and MIDP do not support the complete set of classes from the J2SE API. In fact, CLDC only supports a subset of the standard Java classes. You should download the CLDC API docs to see what functionality is supported. I am willing to bet the functionality is there somewhere, but perhaps in a different class (e.g. Calendar, maybe?).
 
Andy Bowes
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at this web page, I think it gives you all you need :Handling dates in MIDP
The methods that you are attempting to use on the java.util.Date have been deprecated in J2SE since v1.1, it's no wonder they are not included in the CLDC API
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic