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

Date question

Allan Peak

Joined: Jul 10, 2002
Posts: 7
How can I set a Date field to a specific date/time?
rom chatterjee
Ranch Hand

Joined: Dec 11, 2001
Posts: 46
If you mean a java.util.Date object, then you should really be using a java.util.Calendar object. This has set and get methods that take constants representing months, hours, etc

Rom Chatterjee<BR>Sun Certified Java Programmer
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
For more information on using any of the J2SE classes, The API Specification is a good place to begin to understand what a class or instances of a class do and how to use them. Of course, asking questions and searching past conversations at JavaRanch ain't bad either.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
Thanks Dirk!
I agree. Here's the link:
subject: Date question