• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

Question on Creation of a Date Object

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can create a date object with todays date, but how do you create a Date object with a date other than todays Date?
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should familiarize yourself with the Java API docs. They can easily answer this question. For example, I first looked at the Date class (which I found by navigating to the java.util package in the upper left corner at the first link, the API docs).
The constructors that do what you want (at least with the ease that you wish) have been deprecated, but they tell you to check the GregorianCalendar class.
I'll let you browse this last link on your own. Notice that all of the above class documents give links to related classes as well as internal links that help you navigate the given class' docs.
The Java API docs are an indespensible tool in learning how to use the standard Java classes. In fact, many third-party classes are distributed with documentation in the exact format. If you can learn how to navigate the API docs, you will be a long way towards mastering the tools at your disposal.
Layne
 
Robert Young
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you both, that was very helpfull.
Rob
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic