aspose file tools*
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
Author

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
Bartender

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...



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


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
Don't get me started about those stupid light bulbs.
 
subject: Months and years