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

Months and years

Paul Keohan
Ranch Hand

Joined: Mar 15, 2000
Posts: 411
Is there a way in Java to get future month informtaion? Such as, what day of the week is August 15th 2003 going to be. I'm looking at the Calendar class to see if that might provide a way.
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Look into SimpleDateFormat in the API to get the 'patterns' you can use to format a date...

I believe the code below is a quick and dirty ( no error checking ) solution... just run the program, passing in a command-line argument in the form of mm/dd/yyyy, where mm is the month, dd is the day, and yyyy is the year. The program will return the day of the week that date is...

[This message has been edited by Nathan Pruett (edited July 10, 2001).]

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: Months and years
It's not a secret anymore!