File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Date formatting" Watch "Date formatting" New topic

Date formatting

kevin schmidt
Ranch Hand

Joined: Aug 24, 2001
Posts: 85
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.
Manfred Leonhardt
Ranch Hand

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

Margaret Tan

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!!
I agree. Here's the link:
subject: Date formatting
It's not a secret anymore!