This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date question

 
Allan Peak
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I set a Date field to a specific date/time?
 
rom chatterjee
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dirk!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic