| | |
calculate the date difference between two dates exclude the saturday and sunday
![]() |
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
Re: calculate the date difference between two dates exclude the saturday and sunday
0
#2 Dec 11th, 2007
•
•
Join Date: Dec 2007
Posts: 9
Reputation:
Solved Threads: 0
Re: calculate the date difference between two dates exclude the saturday and sunday
0
#3 Dec 11th, 2007
Re: calculate the date difference between two dates exclude the saturday and sunday
0
#4 Dec 11th, 2007
A Loop, counter, an if statement, a Calendar and its add(int, int) and get(int) methods, and its day of the week named constants.
Read the API docs for Calendar, then try to whip something up based on the above, and if it doesn't work, post it, and we'll help you to correct it.
Read the API docs for Calendar, then try to whip something up based on the above, and if it doesn't work, post it, and we'll help you to correct it.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Dec 2007
Posts: 9
Reputation:
Solved Threads: 0
Re: calculate the date difference between two dates exclude the saturday and sunday
0
#5 Dec 13th, 2007
Re: calculate the date difference between two dates exclude the saturday and sunday
0
#6 Dec 13th, 2007
Well, lets see what you have.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Re: calculate the date difference between two dates exclude the saturday and sunday
0
#7 Dec 13th, 2007
pseudo code
Forgot to mention that you will also need compareTo from the Date class (and the if is not needed when done this way).
Java Syntax (Toggle Plain Text)
counter current date = start date // current date is a Calendar object however while (current date less than end date) increment counter add one to current date
Forgot to mention that you will also need compareTo from the Date class (and the if is not needed when done this way).
Last edited by masijade; Dec 13th, 2007 at 6:01 am. Reason: typo and a little further info
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
Re: calculate the date difference between two dates exclude the saturday and sunday
0
#9 Dec 13th, 2007
Re: calculate the date difference between two dates without saturday and sunday
0
#10 Dec 13th, 2007
•
•
•
•
Hi dont mistaken me,i know the logic but some problem occur so you please send to the example code
I am not simply going to post the code here, without you having proven that you have already tried it. From What I see here, you are simply trying to get someone else to do this for you.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
Other Threads in the Java Forum
- Previous Thread: Assistance checking code
- Next Thread: Why don't we have static methods in interface?
| Thread Tools | Search this Thread |
911 addball addressbook android api append applet application apps array arrays automation binary bluetooth businessintelligence button card class client code collision component crashcourse css csv database eclipse ee error fractal free game gis givemetehcodez graphics gui html ide image integer integration j2me japplet java javaarraylist javadoc javafx javaprojects jni jpanel julia jvm linked linux list loan machine map method methods migrate mobile netbeans newbie objects oriented output panel phone physics printf problem program programming project projects radio recursion replaydirector reporting scanner se server service set sms software sort sql string swing test textfield threads transfer tree trolltech ubuntu utility windows






