This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Date formatting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Date formatting" Watch "Date formatting" New topic
Author

Date formatting

kevin schmidt
Ranch Hand

Joined: Aug 24, 2001
Posts: 85
Hi,
I want to display a range of dates like this:
Saturday, October 13, 2001 through Friday, October 19, 2001
Now, as soon as the date changes to the 21st, then it changes to:
Saturday, October 20, 2001 through Friday, October 26, 2001
Is there a simple way of doing this? TIA.
kevin
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Kevin,
Try the following.

Enjoy,
Manfred.
Margaret Tan
Greenhorn

Joined: Sep 14, 2001
Posts: 20
I try running this program. But this is what i get
prompt -> java A
Mon Oct 22 22:11:14 PDT 2001
Saturday, 27 October, 2001 to Friday, 26 October, 2001
Wed Oct 17 22:11:14 PDT 2001
Saturday, 20 October, 2001 to Friday, 19 October, 2001

the ending friday is one day before the beginning saturday???
What's wrong? Thanks in advance
kevin schmidt
Ranch Hand

Joined: Aug 24, 2001
Posts: 85
Thanks Manfred, I managed to get this program to work. Now to answer your question Margaret. I entered the program exactly as shown on the screen and it worked perfectly for me. Thanks for all the help!!
Kevin
 
jQuery in Action, 2nd edition
 
subject: Date formatting