How to use date in java?
If I want a user to input a date alone, not with time, how can I do it? Eg. A customer calls to make a reservation at a restaurant, the user has to key in a date that the customer wants to reserve the place for.
I can't use int cos validating data will be very troublesome right? Is it possible to show me an example? Furthermore, I need to store the date attribute in an object reservation and to later on implement a search function based on the date.
Would really appreciate an example. Thanks so much..
Use the Calendar class for reading and set the allowed formats for the textfield that receives the date. Then store the date in a java.sql.Date object
for use in databases.
Last edited by sjalle; 03-24-2005 at 09:41 PM.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center