|
-
Apr 16th, 2007, 08:54 AM
#1
Thread Starter
Addicted Member
Date Falls On A Weekend?
Hi guys,
Is there any way to determine if a particular date falls on a Weekend using the Calendar class? Just curious to see if there's a way to do it without resorting to
Code:
int currentday = Calendar.DAY_OF_WEEK
if (currentday == Calendar.SATURDAY || currentday == Calendar.SUNDAY)
//etc...
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
-
Apr 16th, 2007, 11:08 PM
#2
Addicted Member
Re: Date Falls On A Weekend?
going through the javadoc for the calandar class I can't see any simplier way then comparing it to saturday and sunday
-
Apr 18th, 2007, 03:20 PM
#3
Re: Date Falls On A Weekend?
There isn't. Of course, the OP's code is simply incorrect. The correct code is
Code:
int currentday = new GregorianCalendar().get(Calendar.DAY_OF_WEEK);
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|